路由器端口少的狀況接多個運營商

 

 

客戶忽然一臺路由器故障,須要臨時用一臺設備替換。但原有設備接了兩條 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
相關文章
相關標籤/搜索