防火墙VRF引流实验
一、实验拓扑

二、实验要求
1、内网通,公网通
2、配置easy ip,内网访问公网
3、内外网流量引流到防火墙
三、实验思路
1.配置vlan和IP地址
2.创建VPN实例
3.配置SW3的vlan
4.创建vlanif并将接口加入相应VPN实例
5.将防火墙接口加入相应区域
6.实现公网通
7.配置OSPF
8.下发缺省并配置easy ip
四、实验步骤
1.配置vlan和IP地址


SW1:
[SW1]vlan 10
[SW1-vlan10]int g 0/0/1
[SW1-GigabitEthernet0/0/1]p l a
[SW1-GigabitEthernet0/0/1]port default vlan 10
[SW1-GigabitEthernet0/0/1]int g 0/0/2
[SW1-GigabitEthernet0/0/2]p l t
[SW1-GigabitEthernet0/0/2]port trunk allow-pass vlan 10
SW2:
[SW2]vlan 20
[SW2-vlan20]int g 0/0/1
[SW2-GigabitEthernet0/0/1]p l a
[SW2-GigabitEthernet0/0/1]port default vlan 20
[SW2-GigabitEthernet0/0/2]p l t
[SW2-GigabitEthernet0/0/2]port trunk allow-pass vlan 20
R2:
[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]ip address 100.1.1.2 24
[R2-GigabitEthernet0/0/0]int l0
[R2-LoopBack0]ip address 2.2.2.2 32
R3:
[R3]int g 0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.4.2 24
[R3-GigabitEthernet0/0/0]int g 0/0/1
[R3-GigabitEthernet0/0/1]ip address 100.1.1.1 24
FW1:
[FW1]int g 1/0/0
[FW1-GigabitEthernet1/0/0]ip address 192.168.3.2 24
[FW1-GigabitEthernet1/0/0]int g 1/0/2
[FW1-GigabitEthernet1/0/2]ip address 192.168.7.2 24
[FW1-GigabitEthernet1/0/2]int g 1/0/1
[FW1-GigabitEthernet1/0/1]ip address 192.168.6.2 24



2.创建VPN实例
[SW3]ip vpn-instance a
[SW3-vpn-instance-a]ipv4-family
[SW3-vpn-instance-a-af-ipv4]route-distinguisher 1:1
[SW3]ip vpn-instance b
[SW3-vpn-instance-b]ip
[SW3-vpn-instance-b]ipv4-family
[SW3-vpn-instance-b-af-ipv4]route-distinguisher 1:2
[SW3]ip vpn-instance c
[SW3-vpn-instance-c]ipv4-family
[SW3-vpn-instance-c-af-ipv4]route-distinguisher 1:3
3.配置SW3的vlan
[SW3]vlan batch 10 20 30 40 60 70
[SW3-GigabitEthernet0/0/1]p l t
[SW3-GigabitEthernet0/0/1]port trunk allow-pass vlan 10
[SW3]int g 0/0/2
[SW3-GigabitEthernet0/0/2]p l t
[SW3-GigabitEthernet0/0/2]port trunk allow-pass vlan 20
[SW3-GigabitEthernet0/0/3]p l a
[SW3-GigabitEthernet0/0/3]port default vlan 30
[SW3-GigabitEthernet0/0/7]p l a
[SW3-GigabitEthernet0/0/7]port default vlan 70
[SW3-GigabitEthernet0/0/6]p l a
[SW3-GigabitEthernet0/0/6]port default vlan 60
[SW3-GigabitEthernet0/0/4]p l a
[SW3-GigabitEthernet0/0/4]port default vlan 40
4.创建vlanif并将接口加入相应VPN实例
[SW3]int Vlanif 10
[SW3-Vlanif10]ip binding vpn-instance a
[SW3-Vlanif10]ip address 192.168.1.254 24
[SW3]int Vlanif 60
[SW3-Vlanif60]ip binding vpn-instance a
[SW3-Vlanif60]ip address 192.168.6.1 24
[SW3]int Vlanif 20
[SW3-Vlanif20]ip binding vpn-instance b
[SW3-Vlanif20]ip address 192.168.2.254 24
[SW3]int Vlanif 70
[SW3-Vlanif70]ip binding vpn-instance b
[SW3-Vlanif70]ip address 192.168.7.1 24
[SW3]int Vlanif 40
[SW3-Vlanif40]ip binding vpn-instance c
[SW3-Vlanif40]ip address 192.168.4.1 24
[SW3]int Vlanif 30
[SW3-Vlanif30]ip binding vpn-instance c
[SW3-Vlanif30]ip address 192.168.3.1 24

5.将防火墙接口加入相应区域
[FW1]firewall zone trust
[FW1-zone-trust]add int g 1/0/0
[FW1-zone-trust]add int g 1/0/2
[FW1-zone-trust]add int g 1/0/1
6.实现公网通
[R3]ip route-static 0.0.0.0 0 100.1.1.2
7.配置OSPF
SW3:
[SW3-ospf-1]ospf 1 router-id 1.1.1.1 vpn-instance a
[SW3-ospf-1-area-0.0.0.0]a 0
[SW3-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[SW3-ospf-1-area-0.0.0.0]network 192.168.6.0 0.0.0.255
[SW3]ospf 2 router-id 2.2.2.2 vpn-instance b
[SW3-ospf-2]a 0
[SW3-ospf-2-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[SW3-ospf-2-area-0.0.0.0]network 192.168.7.0 0.0.0.255
[SW3]ospf 3 router-id 3.3.3.3 vpn-instance c
[SW3-ospf-3]a 0
[SW3-ospf-3-area-0.0.0.0]network 192.168.4.0 0.0.0.255
[SW3-ospf-3-area-0.0.0.0]network 192.168.3.0 0.0.0.255
R3:
[R3]ospf 1 router-id 33.33.33.33
[R3-ospf-1]a 0
[R3-ospf-1-area-0.0.0.0]network 192.168.4.0 0.0.0.255
FW1:
[FW1]ospf 1 router-id 11.11.11.11
[FW1-ospf-1]a 0
[FW1-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255
[FW1-ospf-1-area-0.0.0.0]network 192.168.7.0 0.0.0.255
[FW1-ospf-1-area-0.0.0.0]network 192.168.6.0 0.0.0.255

8.下发缺省并配置easy ip
[R3]ospf 1
[R3-ospf-1]default-route-advertise always
[R3]acl 2000
[R3-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[R3-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255
[R3]int g 0/0/1
[R3-GigabitEthernet0/0/1]nat outbound 2000
五、实验测试



DAMO开发者矩阵,由阿里巴巴达摩院和中国互联网协会联合发起,致力于探讨最前沿的技术趋势与应用成果,搭建高质量的交流与分享平台,推动技术创新与产业应用链接,围绕“人工智能与新型计算”构建开放共享的开发者生态。
更多推荐


所有评论(0)