網絡拓撲以下:
node
組網狀況:網絡
企業用戶主要有技術部(VLAN10)和行政部(VLAN20),經過匯聚交換機鏈接到USG。session
企業分別經過兩個不一樣運營商(ISP1和ISP2)鏈接到Internet,ISP1分配的IP地址是1.1.1.1~1.1.1.10,ISP2分配的IP地址是2.2.2.1~2.2.2.10,掩碼均爲24位。app
須要實現如下需求:ide
當通往兩個運營商鏈路都正常工做的狀況下,技術部用戶經過運營商ISP1訪問Internet,行政部用戶經過運營商ISP2訪問Internet。測試
當一條鏈路出現故障時,流量能夠被及時切換到另外一條鏈路上,避免網絡長時間中斷。spa
匯聚SW配置:orm
vlan batch 10 20server
interface GigabitEthernet0/0/1blog
port link-type access
port default vlan 10
stp edged-port enable
interface GigabitEthernet0/0/2
port link-type access
port default vlan 20
stp edged-port enable
interface GigabitEthernet0/0/24
port link-type trunk
port trunk allow-pass vlan 10 20
USG配置:
1.接口及區域配置
interface GigabitEthernet0/0/0.1
vlan-type dot1q 10
alias GigabitEthernet0/0/0.1
ip address 10.1.1.1 255.255.255.0
dhcp select interface
dhcp server gateway-list 10.1.1.1
interface GigabitEthernet0/0/0.2
vlan-type dot1q 20
alias GigabitEthernet0/0/0.2
ip address 10.1.2.1 255.255.255.0
dhcp select interface
dhcp server gateway-list 10.1.2.1
interface GigabitEthernet0/0/1
ip address 1.1.1.1 255.255.255.0
interface GigabitEthernet0/0/2
ip address 2.2.2.1 255.255.255.0
firewall zone trust
set priority 85
add interface GigabitEthernet0/0/0
add interface GigabitEthernet0/0/0.1
add interface GigabitEthernet0/0/0.2
firewall zone name isp1
set priority 30
add interface GigabitEthernet0/0/1
firewall zone name isp2
set priority 35
add interface GigabitEthernet0/0/2
2.域間策略配置:
policy interzone trust isp1 outbound
policy 1
action permit
policy source 10.1.0.0 0.0.255.255
policy interzone trust isp2 outbound
policy 1
action permit
policy source 10.1.0.0 0.0.255.255
3.NAT配置:
nat address-group 1 jishu 1.1.1.5 1.1.1.10
nat address-group 2 xingzheng 2.2.2.5 2.2.2.10
nat-policy interzone trust isp1 outbound
policy 1
action source-nat
policy source 10.1.0.0 0.0.255.255
address-group jishu
nat-policy interzone trust isp2 outbound
policy 1
action source-nat
policy source 10.1.0.0 0.0.255.255
address-group xingzheng
4.IP-Link鏈路檢測配置
ip-link check enable
ip-link 1 destination 1.1.1.100 interface GigabitEthernet 0/0/1 mode icmp
ip-link 2 destination 2.2.2.100 interface GigabitEthernet 0/0/2 mode icmp
5.策略路由配置
acl number 3001
rule 10 permit ip source 10.1.1.0 0.0.0.255
acl number 3002
rule 10 permit ip source 10.1.2.0 0.0.0.255
policy-based-route huawei permit node 1
if-match acl 3001
apply ip-address next-hop 1.1.1.100
policy-based-route huawei permit node 2
if-match acl 3002
apply ip-address next-hop 2.2.2.100
分別在G0/0/0.1和G0/0/0.2上引用該策略路由
interface GigabitEthernet0/0/0.1
ip policy-based-route huawei
interface GigabitEthernet0/0/0.2
ip policy-based-route huawei
分別輸入至ISP-1和ISP-2的兩條默認路由
ip route-static 0.0.0.0 0.0.0.0 1.1.1.100 track ip-link 1
ip route-static 0.0.0.0 0.0.0.0 2.2.2.100 track ip-link 2
ISP-1和ISP-2接口配置:
ISP-1:
interface GigabitEthernet0/0/0
ip address 1.1.1.100 255.255.255.0
ISP-2:
interface GigabitEthernet0/0/0
ip address 2.2.2.100 255.255.255.0
測試:
1.分別在技術部和行政部電腦上ping 8.8.8.8 -t ,在USG輸入:display firewall session table verbose上查看NAT轉換狀況,以下圖所示:
2.此時將ISP-1的G0/0/0口shutdown,觀察技術部是否會切換到ISP-2訪問Internet。
由上看出,技術部10.1.1.2已成功被轉換成2.2.2.10了。
至此,實驗配置所有完成。