实 验 报 告

防火墙引流实验

一.实验目的

1.内网通,公网通

2.配置easy ip,内网访问1公网

3.内外网流量引流到防火墙

二.实验思路

1、按规划配置各设备接口 IP 地址、VLAN 划分与二层 access 端口。

2、在 LSW3 上创建a.b. c 三个实例(RD 分别为 1:1、1:2、1:3),并把 VLANIF 接口分别绑定到对应实例,实现用户侧与防火墙侧的路由表隔离。

3、在 LSW3 上配置 VLANIF 网关与各实例的静态路由,使用户侧实例的默认路由指向防火墙互联地址,打通内网与公网。

4、在 FW1 上划分 trust、untrust 安全区域,配置接口地址、回程明细路由与安全策略(含同区域互访),使上下行流量均经防火墙转发。

5、在 R3 上用 ACL 2000 匹配两个内网网段,并在 GE0/0/1 上配置 Easy IP,实现内网通过公网地址访问 2.2.2.2。

6、用 ping 验证内网互通与公网可达,用 tracert 确认路径经过防火墙。

三.实验配置

1.R2

interface GigabitEthernet0/0/0

 ip address 100.1.1.2 24

 quit

interface LoopBack0

 ip address 2.2.2.2 32

 quit

ip route-static 0.0.0.0 0 100.1.1.1

2.R3(ACL 2000 精确匹配两个内网网段,nat outbound 2000 使用出接口地址做转换(Easy IP);192.168.0.0/16 的回程路由保证 NAT 还原后的私网报文能回到内网。)

interface GigabitEthernet0/0/1

 ip address 100.1.1.1 24

 quit

interface GigabitEthernet0/0/0

 ip address 192.168.4.1 24

 quit

acl number 2000

 rule 5 permit source 192.168.1.0 0.0.0.255

 rule 10 permit source 192.168.2.0 0.0.0.255

 quit

interface GigabitEthernet0/0/1

 nat outbound 2000

 quit

ip route-static 0.0.0.0 0 100.1.1.2

ip route-static 192.168.0.0 16 192.168.4.254

  1. SW3(VLAN 网关+ 实例+引流)

vlan batch 10 20 30 40 60 70

ip vpn-instance vpn-a

 ipv4-family

  route-distinguisher 1:1

  quit

 quit

ip vpn-instance vpn-b

 ipv4-family

  route-distinguisher 1:2

  quit

 quit

ip vpn-instance vpn-c

 ipv4-family

  route-distinguisher 1:3

  quit

 quit

随后创建 VLAN 接口并绑定实例,再配置地址

interface Vlanif10

 ip binding vpn-instance vpn-a

 ip address 192.168.1.254 24

 quit

interface Vlanif20

 ip binding vpn-instance vpn-b

 ip address 192.168.2.254 24

 quit

interface Vlanif30

 ip binding vpn-instance vpn-c

 ip address 192.168.3.254 24

 quit

interface Vlanif40

 ip binding vpn-instance vpn-c

 ip address 192.168.4.254 24

 quit

interface Vlanif60

 ip binding vpn-instance vpn-a

 ip address 192.168.6.254 24

 quit

interface Vlanif70

 ip binding vpn-instance vpn-b

 ip address 192.168.7.254 24

 quit

实例与 Vlanif 绑定完成后,再按 VLAN 划分物理端口,并按实例分别配置默认路由与回程明细路由。

interface GigabitEthernet0/0/1

 port link-type access

 port default vlan 10

 quit

(G0/0/2、G0/0/3、G0/0/4、G0/0/6、G0/0/7分别划入 VLAN20、30、40、60、70)

ip route-static vpn-instance vpn-a 0.0.0.0 0 192.168.6.1

ip route-static vpn-instance vpn-b 0.0.0.0 0 192.168.7.1

ip route-static vpn-instance vpn-c 0.0.0.0 0 192.168.4.1

ip route-static vpn-instance vpn-c 192.168.1.0 24 192.168.3.1

ip route-static vpn-instance vpn-c 192.168.2.0 24 192.168.3.1

  1. SW1

vlan batch 10

interface GigabitEthernet0/0/2

 port link-type access

 port default vlan 10

 quit

interface GigabitEthernet0/0/1

 port link-type access

 port default vlan 10

 quit

  1. SW2

vlan batch 20

interface GigabitEthernet0/0/2

 port link-type access

 port default vlan 20

 quit

interface GigabitEthernet0/0/1

 port link-type access

 port default vlan 20

 quit

  1. FW1

interface GigabitEthernet1/0/0

 ip address 192.168.3.1 24

 service-manage ping permit

 quit

interface GigabitEthernet1/0/1

 ip address 192.168.6.1 24

 service-manage ping permit

 quit

interface GigabitEthernet1/0/2

 ip address 192.168.7.1 24

 service-manage ping permit

 quit

firewall zone trust

 add interface GigabitEthernet1/0/1

 add interface GigabitEthernet1/0/2

 quit

firewall zone untrust

 add interface GigabitEthernet1/0/0

ip route-static 0.0.0.0 0 192.168.3.254

ip route-static 192.168.1.0 24 192.168.6.254

ip route-static 192.168.2.0 24 192.168.7.254

security-policy

 rule name trust_to_untrust

  source-zone trust

  destination-zone untrust

  action permit

  quit

 rule name trust_to_trust

  source-zone trust

  destination-zone trust

  action permit

  quit

 rule name untrust_to_trust

  source-zone untrust

  destination-zone trust

  source-address 2.2.2.2 32

  action permit

  1. 终端

PC1:192.168.1.10/24,网关 192.168.1.254;

PC2:192.168.2.10/24,网关 192.168.2.254。

  • 实验验证

要求一:内网通、公网通

验证方法:PC1 上分别 ping 192.168.2.10 与 ping 2.2.2.2,前者验证 VLAN10 与 VLAN20 跨网段互通,后者验证经出口路由器访问公网主机 2.2.2.2。同时反着验证PC2ping192.168.1.10。

要求二:Easy IP 生效

验证方法:先查看 R3 的 GE0/0/1 配置,确认 nat outbound 2000 存在;再让 PC1 保持 ping 2.2.2.2 不中断.同时执行 display nat session all 观察地址转换情况。

要求三:内外网流量引流到防火墙

验证方法:PC1 上执行 tracert 2.2.2.2 观察路径;再在 PC1 持续 ping 时到 FW1 上查看会话表,确认接口方向。

Logo

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

更多推荐