|
雙出口映射單網(wǎng)卡服務(wù)器解決方案 一、 解決方案應(yīng)用場景:出口路由器接兩家運營商線路,均使用固定公網(wǎng)地址上外網(wǎng), 內(nèi)網(wǎng)有一臺單網(wǎng)卡的FTP 服務(wù)器,現(xiàn)要將其分別映射至兩個公網(wǎng)出口,實現(xiàn)外網(wǎng)用戶 通過公網(wǎng)地址能正常訪問FTP 服務(wù)器。 二、 網(wǎng)絡(luò)拓撲圖: 三、 解決方案思路: 1. 內(nèi)網(wǎng)用戶上公網(wǎng)通過在兩個公網(wǎng)口分別做nat outbound,電信出接口配置一條默認路由, 網(wǎng)通出接口配置一條優(yōu)先級低于電信出接口的默認路由并添加目的地址為網(wǎng)通網(wǎng)段的 精細路由; 2. 若雙出口上映射同一個FTP 服務(wù)器的私網(wǎng)地址,則可能出現(xiàn)端口被占用的情況,為解決 這個問題,給服務(wù)器配置兩個私網(wǎng)地址,分別用做兩個外網(wǎng)口上做nat server 的內(nèi)部地 址:其中電信出口映射的內(nèi)部地址為192.168.1.253,網(wǎng)通出口映射的內(nèi)部地址為 192.168.1.254; 3. 做完以上兩個步驟后,電信地址訪問電信出口沒有問題,網(wǎng)通地址訪問網(wǎng)通出口也沒有 問題,但是網(wǎng)通地址訪問電信出口就會出現(xiàn)數(shù)據(jù)包來回路徑不一致的現(xiàn)象:網(wǎng)通地址訪 問電信接口時,首先電信出接口通過nat server 定向至192.168.1.253,服務(wù)器回包時一 看源地址為網(wǎng)通地址,就匹配精細路由出去了。同樣的電信地址訪問網(wǎng)通出接口也可能 出現(xiàn)數(shù)據(jù)包來回不一致的情況; 4. 為解決第3 步出現(xiàn)的問題,通過定義匹配源的策略路由來解決:源為192.168.1.253 目的 UnRegistered 地址任意的訪問下一跳指向電信出口網(wǎng)關(guān),源為192.168.1.254 目的地址任意的訪問下一 跳指向網(wǎng)通出口網(wǎng)關(guān)。此時網(wǎng)通地址訪問電信出接口時,首先電信出接口通過nat server 定向至192.168.1.253,服務(wù)器回包時匹配源為192.168.1.253 的策略路由,仍然走電信出 接口出去,這樣就實現(xiàn)了數(shù)據(jù)包的來回一致,電信地址訪問網(wǎng)通出接口也是一樣。 五、 測試配置文件 出口路由器:MSR30-11 # acl number 2000 rule 0 permit # acl number 3000 //定義源為192.168.1.253 的ACL rule 0 permit ip source 192.168.1.253 0 acl number 3001 //定義源為192.168.1.254 的ACL rule 0 permit ip source 192.168.1.254 0 # vlan 1 # domain system access-limit disable state active idle-cut disable self-service-url disable # user-group system # local-user admin password cipher .]@USE=B,53Q=^Q`MAF4<1!! authorization-attribute level 3 service-type telnet # cwmp undo cwmp enable # interface Aux0 async mode flow link-protocol ppp # interface Ethernet0/0 //此接口為出口路由器的內(nèi)網(wǎng)口 port link-mode route ip address 192.168.1.1 255.255.255.0 undo ipv6 fast-forwarding ip policy-based-route policy //將匹配源地址為服務(wù)器私網(wǎng)地址的策略路由下發(fā)至內(nèi)網(wǎng)口 # interface Ethernet0/1 UnRegistered port link-mode route undo ipv6 fast-forwarding # interface Ethernet3/0 //此接口為電信出接口 port link-mode route description to-dianxin nat outbound 2000 nat server protocol tcp global 10.10.10.1 ftp inside 192.168.1.253 ftp //映射192.168.1.253 ip address 10.10.10.1 255.255.255.252 undo ipv6 fast-forwarding # interface Ethernet3/1 //此接口為網(wǎng)通出接口 port link-mode route description to-wangtong nat outbound 2000 nat server protocol tcp global 20.20.20.1 ftp inside 192.168.1.254 ftp //映射192.168.1.254 ip address 20.20.20.1 255.255.255.252 undo ipv6 fast-forwarding # interface Serial0/0 link-protocol ppp undo ipv6 fast-forwarding # interface NULL0 # policy-based-route policy permit node 0 //匹配ACL3000 的走電信出接口 if-match acl 3000 apply ip-address next-hop 10.10.10.2 policy-based-route policy permit node 5 //匹配ACL3001 的走網(wǎng)通出接口 if-match acl 3001 apply ip-address next-hop 20.20.20.2 # ip route-static 0.0.0.0 0.0.0.0 10.10.10.2 ip route-static 0.0.0.0 0.0.0.0 20.20.20.2 preference 80 ip route-static 3.3.3.0 255.255.255.0 20.20.20.2 //實際配置時需添加網(wǎng)通網(wǎng)段的細化路由 # 電信設(shè)備:100F 網(wǎng)通設(shè)備:100F 電信和網(wǎng)通之間的互聯(lián)網(wǎng)段為:3.3.3.0/24,電信:3.3.3.253 網(wǎng)通:3.3.3.254 UnRegistered |
|
|