客户突然一台路由器故障,需要临时用一台设备替换。但原有设备接了两条 ISP 线路,而现有条件现我们只有一台两个标配口的路由器。想需求帮助。因为只有两个端口采用增加一台傻瓜交换机的方法。如下所示:
 
配置文件如下: ( 模拟的环境为,一个 ISP ADSL 拨号,别一个 ISP 为固定 IP 的情况。其他的情况类似)
 
企业内部路由器( h3c) 的配置:
[H3C]dis current-configuration
#
 version 5.20, Release 2209, Standard
#
 sysname H3C
#
 domain default enable system
#
 dar p2p signature-file cfa0:/p2p_default.mtd
#
 port-security enable
#
acl number 2000
 rule 0 permit         //nat 需要
#
vlan 1
#
domain system
 access-limit disable
 state active
 idle-cut disable
 self-service-url disable
#
user-group system
 group-attribute allow-guest
#
local-user admin
 password cipher $c$3$40gC1cxf/wIJNa1ufFPJsjKAof+QP5aV
 authorization-attribute level 3
 service-type telnet
#
cwmp
 undo cwmp enable
#
interface Aux0
 async mode flow
 link-protocol ppp
#
interface Cellular0/0
 async mode protocol
 link-protocol ppp
#
interface Dialer1                      //pppoe 拨号接口
 description to-WAN1
 nat outbound 2000
 link-protocol ppp
 ppp chap user test1
 ppp chap password cipher $c$3$T7uUvtfkhUa3z6I8fwgcmoLnADXbeAg=
 mtu 1452
 ip address ppp-negotiate
 dialer user wan1
 dialer-group 1
 dialer bundle 1
#
interface Dialer2
 description to-WAN2
 nat outbound 2000
 link-protocol ppp
 ppp chap user test2
 ppp chap password cipher $c$3$GtPZ1T8H7EndXgbGwjDirDN2ZTHd0h4=
 mtu 1452
 shutdown
 ip address ppp-negotiate
 dialer user wan2
 dialer-group 2
 dialer bundle 2
#
interface Ethernet0/0           // 固定 IP 地址接口
 port link-mode route
 pppoe-client dial-bundle-number 1   // 这里是配置关键点,后面的路由也要区分开来见
 ip address 2.2.2.2 255.255.255.0         
#
interface Ethernet0/1   //内网用户
 port link-mode route
 ip address 192.168.1.1 255.255.255.0
#
interface NULL0
#
 ip route-static 0.0.0.0 0.0.0.0 Dialer1
 ip route-static 0.0.0.0 0.0.0.0 2.2.2.1
#
 dialer-rule 1 ip permit
 dialer-rule 2 ip permit
#
 load xml-configuration
#
 load tr069-configuration
#
user-interface con 0
user-interface tty 13
user-interface aux 0
user-interface vty 0 4
 authentication-mode scheme
#              
return
 
模拟运营商 1
<pppoe-server1>dis current-configuration
#
 version 5.20, Release 2209P01, Standard
#
 sysname pppoe-server1
#
 domain default enable system
#
 dar p2p signature-file cfa0:/p2p_default.mtd
#
 port-security enable
#
vlan 1
#
domain system
 access-limit disable
 state active
 idle-cut disable
 self-service-url disable
 ip pool 1 1.1.1.2 1.1.1.10
#
user-group system
 group-attribute allow-guest
#
local-user admin
 password cipher $c$3$40gC1cxf/wIJNa1ufFPJsjKAof+QP5aV
 authorization-attribute level 3
 service-type telnet
local-user test1
 password cipher $c$3$AzWYMuNIAtXMX/8CCTWtbgUo+gRsmcI=
 service-type ppp
#
cwmp
 undo cwmp enable
#
interface Aux0
 async mode flow
 link-protocol ppp
#
interface Cellular0/0
 async mode protocol
 link-protocol ppp
#
interface Ethernet0/0
 port link-mode route
 pppoe-server bind Virtual-Template 1
#
interface Ethernet0/1
 port link-mode route
#
interface Virtual-Template1
 ppp authentication-mode chap
 ppp chap user test1
 remote address pool 1
 ip address 1.1.1.1 255.255.255.0
#
interface NULL0
#
interface LoopBack1
 ip address 11.11.11.11 255.255.255.255
#
 load xml-configuration
#
 load tr069-configuration
#
user-interface con 0
user-interface tty 13
user-interface aux 0
user-interface vty 0 4
 authentication-mode scheme
#              
return
<pppoe-server1>     
 
模拟运营商 2
<pppoe-server2>dis current-configuration
#
 version 5.20, Release 2209P01, Standard
#
 sysname pppoe-server2
#
vlan 1
#
domain system
 access-limit disable
 state active
 idle-cut disable
 self-service-url disable
 ip pool 1 2.2.2.2 2.2.2.10
#
local-user test2
 password cipher $c$3$40gC1cxf/wIJNa1ufFPJsjFJtP6OIvg=
 service-type ppp
#
interface Cellular0/0
 async mode protocol
 link-protocol ppp
#
interface Ethernet0/0
 port link-mode route
 ip address 2.2.2.1 255.255.255.0
#
interface LoopBack0
 ip address 192.168.10.1 255.255.255.255
#
interface LoopBack1
 ip address 22.22.22.22 255.255.255.255
load xml-configuration
#              
 load tr069-configuration
#
user-interface con 0
user-interface tty 13
user-interface aux 0
user-interface vty 0 4
 authentication-mode scheme
#
return
 
 
 
上面案例中,如果两条线路都是 ADSL 的情况下就是这样了
interface Ethernet0/0           // 固定 IP 地址接口
 port link-mode route
 pppoe-client dial-bundle-number 1   // 对应 dailer1
 pppoe-client dial-bundle-number 2        // 对应 dialer2
 
 
 
PS :这里我们不能使用子接口的方式, ( interface eth0/0.1   interface eth0/0.2 )为什么呢?
以太网子接口只有在关联了 VLAN 后才能被激活,正常的收发报文。相关配置请参见“二层技术 - 以太网交换配置指导”中的“ VLAN 终结”。
本端设备以太网子接口号、 VLAN ID 需要分别和相连的对端设备的以太网子接口号、 VLAN ID 一致,否则报文将不能正确传输。
 
 
这是我们要注意的,理解一下Vlan标签的思路我们就清楚了。谢谢!!
 
王老吉出品,必属精品。
QQ 303118106