路由器—双外网(PPPOE宽带和固定IP地址)
路由器—双外网(PPPOE宽带和固定IP地址)
AR2:
#
sysname AR2
#
acl number 3000 \\配置所有内网网段到外网的访问规则
rule 1 permit ip
acl number 3001 \\配置1.0网段到PPPOE宽带的访问规则
rule 1 permit ip source 192.168.1.0 0.0.0.255
acl number 3002 \\配置2.0网段到固定IP地址的访问规则
rule 1 permit ip source 192.168.2.0 0.0.0.255
traffic behavior b2
permit \\配置流行为b2,动作为允许报文通过
redirect ip-nexthop 222.222.222.1 \\指定出口下一跳IP地址去往固定IP地址
traffic behavior b1
permit \\配置流行为b1,动作为允许报文通过
redirect interface Dialer0 \\指定出口下一跳IP地址去往PPPOE宽带
#
traffic policy p2 \\配置流策略p2,将流分类C2 与流行为b2关联
classifier c2 behavior b2
traffic policy p1 \\配置流策略p1,将流分类C1与流行为b1关联
classifier c1 behavior b1
#
interface Dialer0 \\配置拨号接口 0
link-protocol ppp \\协议是PPP
ppp chap user admin \\配置被认证方的chap账号
ppp chap password cipher admin \\配置chap密码
mtu 1492 \\修改MTU为1500-8=1492 ,1500是以太网最大传输单元,8是PPP头部长度
tcp adjust-mss 1200 \\配置TCP最大报文段长度
ip address ppp-negotiate \\配置IP地址采用PPP协商方式获取,即通过
服务器的地址池分配
dialer user admin \\配置拨号用户,这个是非按需拨号时要配置
dialer bundle 1 \\配置拨号链接的编号 1,1要和下面接口的的配置对应
nat outbound 3000 \\配置Easy IP方式的NAT Outbound
#
interface GigabitEthernet0/0/0
ip address 222.222.222.2 255.255.255.252
traffic-policy p2 inbound \\将流策略p2应用到接口
nat outbound 3000
#
interface GigabitEthernet0/0/1
pppoe-client dial-bundle-number 1 \\在以太网接口上启用PPPoE Client功能
traffic-policy p1 inbound \\将流策略p1应用到接口
#
interface GigabitEthernet0/0/2
ip address 20.20.20.1 255.255.255.0
#
dialer-rule \\配置拨号规则,IP流量触发PPP拨号
dialer-rule 1 ip permit
#
ip route-static 0.0.0.0 0.0.0.0 Dialer0 \\配置用于上网的默认路由,
注意出口是拨号接口Dialer0
ip route-static 0.0.0.0 0.0.0.0 222.222.222.1 \\配置到固定IP地址的外网
ip route-static 192.168.1.0 255.255.255.0 20.20.20.2
ip route-static 192.168.2.0 255.255.255.0 20.20.20.2
S1:
#
sysname S1
#
vlan batch 10 20 30
#
dhcp enable
#
ip pool vlan20
gateway-list 192.168.1.1
network 192.168.1.0 mask 255.255.255.0
dns-list 202.106.0.20
#
ip pool vlan30
gateway-list 192.168.2.1
network 192.168.2.0 mask 255.255.255.0
dns-list 219.141.136.10
#
interface Vlanif10
ip address 20.20.20.2 255.255.255.0
#
interface Vlanif20
ip address 192.168.1.1 255.255.255.0
dhcp select global
#
interface Vlanif30
ip address 192.168.2.1 255.255.255.0
dhcp select global
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 20
#
interface GigabitEthernet0/0/3
port link-type access
port default vlan 30
#
ip route-static 0.0.0.0 0.0.0.0 20.20.20.1
AR1:
#
sysname AR1
#
dhcp enable
#
ip pool 1 \\创建地址池用来为客户端分配地址
gateway-list 111.111.111.1
network 111.111.111.0 mask 255.255.255.252
dns-list 8.8.8.8
#
aaa \\在AAA下配置认证方案和创建用于认证的账号
authentication-scheme system_a
domain system
authentication-scheme system_a
local-user admin password cipher admin \\配置PPPoE Client的用户名和密码
local-user admin service-type ppp \\配置PPPoE Client的接入类型
#
interface Virtual-Template1 \\配置虚拟接口模板
ppp authentication-mode chap domain system \\配置虚拟接口模板的PPP认证方式,
以便对PPPoE Client进行CHAP认证
remote address pool 1 \\配置为PPPoE Client指定IP地址池,
PPPoE Client将分配到IP地址池中的IP地址
ip address 111.111.111.1 255.255.255.252
#
interface GigabitEthernet0/0/0
ip address 202.106.0.1 255.255.255.0
#
interface GigabitEthernet0/0/1
pppoe-server bind Virtual-Template 1 \\接口上开启PPPOE服务器的功能
#
interface GigabitEthernet0/0/2
ip address 10.10.10.1 255.255.255.0
dhcp select interface
dhcp server dns-list 202.106.0.20
#
ip route-static 0.0.0.0 0.0.0.0 Virtual-Template1
AR3:
#
sysname AR3
#
dhcp enable
#
acl number 3001
rule 1 permit ip source 172.100.10.0 0.0.0.255
rule 2 permit ip source 219.141.136.0 0.0.0.255
#
interface GigabitEthernet0/0/0
ip address 222.222.222.1 255.255.255.252
nat outbound 3001
#
interface GigabitEthernet0/0/1
ip address 172.100.10.1 255.255.255.0
dhcp select interface
dhcp server dns-list 219.141.136.10
#
interface GigabitEthernet0/0/2
ip address 219.141.136.1 255.255.255.0
#
ip route-static 0.0.0.0 0.0.0.0 222.222.222.2
实验结果:
- 点赞
- 收藏
- 关注作者
评论(0)