作者:啊健oo | 来源:互联网 | 2024-12-24 14:57
网络拓扑如下:组网情况:企业用户主要有技术部(VLAN10)和行政部(VLAN20),通过汇聚交换机连接到USG。企业分别通过两个不同运营商(ISP1和ISP2)连接到
网络拓扑如下:
组网情况:
需要实现以下需求:
当通往两个运营商链路都正常工作的情况下,技术部用户通过运营商ISP1访问Internet,行政部用户通过运营商ISP2访问Internet。
当一条链路出现故障时,流量可以被及时切换到另一条链路上,避免网络长时间中断。
汇聚SW配置:
vlan batch 10 20
interface GigabitEthernet0/0/1
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了。
至此,实验配置全部完成。