防火墙互通案例-0215
一:拓扑图
防火墙要配置1024M内存
拓扑讲解:
56.2 环回适配器,桥接模式
PC机与56.2 互通,56.2 与 56.30 互通
FW 配置后 与 200.x段互通
200.10 使用环回适配器,桥接模式
桥接在vmware配置关联
VMware虚拟机桥接
二:交换机配置
给vlan 1 配置IP地址 192.168.200.3
配置默认路由地址为网关地址 192.168.200.1
system-view
sysname SW
telnet server enable
line vty 0 4
authentication-mode scheme
user-role network-admin
quit
local-user admin
password simple gh2023meng
service-type telnet
authorization-attribute user-role network-admin
interface Vlan-interface 1
ip address 192.168.200.3 255.255.255.0
quit
ip route-static 0.0.0.0 0 192.168.200.1
save
三:防火墙配置
创建vlan 200 配置网关IP地址
开启hairpin功能,开启telnet功能,
配置外网03口,启用NAT映射,防火墙出口IP(外网IP,192.168.56.30)
配置内网04口,划入vlan200
配置信任区域把 04口,vlan200划入Trust
配置默认路由 192.168.56.1
开启http https
配置信任策略 Untrust ->Trust,Local Local->Untrust,Trust Trust->Untrust,Local
system-view
[FW]sysname FW
[FW]telnet server enable
[FW]vlan 200
[FW]quit
[FW]interface Vlan-interface 200
[FW]ip address 192.168.200.1 255.255.255.0
[FW]nat hairpin enable
[FW]quit
[FW]interface GigabitEthernet 1/0/3
[FW]ip address 192.168.56.30 255.255.255.0
[FW]nat outbound counting
[FW]nat server protocol tcp global 192.168.56.30 10002 inside 192.168.200.3 23
[FW]nat server protocol tcp global 192.168.56.30 10003 inside 192.168.200.10 8000
[FW]quit
[FW]interface GigabitEthernet 1/0/4
[FW]port link-mode bridge
[FW]port access vlan 200
[FW]quit
[FW]security-zone name Trust
[FW]import interface Vlan-interface 200
[FW]import interface GigabitEthernet 1/0/4 vlan 200
[FW]quit
[FW]security-zone name Untrust
[FW]import interface GigabitEthernet 1/0/3
[FW]quit
[FW]ip route-static 0.0.0.0 0 192.168.56.1
[FW]ip http enable
[FW]ip https enable
[FW]security-policy ip
[FW]rule 1 name Untrust_Trust_1_IPv4
[FW]action pass
[FW]source-zone Untrust
[FW]destination-zone Trust
[FW]rule 2 name Untrust_Local_2_IPv4
[FW]action pass
[FW]source-zone Untrust
[FW]destination-zone Local
[FW]rule 3 name Local_Untrust_3_IPv4
[FW]action pass
[FW]source-zone Local
[FW]destination-zone Untrust
[FW]rule 4 name Trust_Untrust_4_IPv4
[FW]action pass
[FW]source-zone Trust
[FW]destination-zone Untrust
[FW]rule 5 name Trust_Local_5_IPv4
[FW]action pass
[FW]source-zone Trust
[FW]destination-zone Local
[FW]rule 6 name Local_Trust_6_IPv4
[FW]action pass
[FW]source-zone Local
[FW]destination-zone Trust
[FW]quit
[FW]save
模拟器可能需要重启防火墙/交换机/PC机
验证端口:
192.168.200.10 部署简易服务
python -m SimpleHTTPServer
同网段访问验证NAT配置
wget http://192.168.56.30:10003/a.txt
PC机路由
C:\Users\mengsy>route print
IPv4 路由表
活动路由:
网络目标 网络掩码 网关 接口 跃点数
0.0.0.0 0.0.0.0 192.168.204.111 192.168.204.177 35
127.0.0.0 255.0.0.0 在链路上 127.0.0.1 331
127.0.0.1 255.255.255.255 在链路上 127.0.0.1 331
127.255.255.255 255.255.255.255 在链路上 127.0.0.1 331
#vmware vnet 8
192.168.10.0 255.255.255.0 在链路上 192.168.10.1 291
192.168.10.1 255.255.255.255 在链路上 192.168.10.1 291
192.168.10.255 255.255.255.255 在链路上 192.168.10.1 291
#vmware vnet 1
192.168.20.0 255.255.255.0 在链路上 192.168.20.1 291
192.168.20.1 255.255.255.255 在链路上 192.168.20.1 291
192.168.20.255 255.255.255.255 在链路上 192.168.20.1 291
#环回适配器1
192.168.56.0 255.255.255.0 在链路上 192.168.56.2 281
192.168.56.2 255.255.255.255 在链路上 192.168.56.2 281
192.168.56.255 255.255.255.255 在链路上 192.168.56.2 281
#环回适配器2
192.168.200.0 255.255.255.0 在链路上 192.168.200.4 281
192.168.200.4 255.255.255.255 在链路上 192.168.200.4 281
192.168.200.255 255.255.255.255 在链路上 192.168.200.4 281
#PC机路由
192.168.204.0 255.255.255.0 在链路上 192.168.204.177 291
192.168.204.177 255.255.255.255 在链路上 192.168.204.177 291
192.168.204.255 255.255.255.255 在链路上 192.168.204.177 291
224.0.0.0 240.0.0.0 在链路上 127.0.0.1 331
224.0.0.0 240.0.0.0 在链路上 169.168.56.1 281
224.0.0.0 240.0.0.0 在链路上 192.168.0.2 281
224.0.0.0 240.0.0.0 在链路上 192.168.20.1 291
224.0.0.0 240.0.0.0 在链路上 192.168.10.1 291
224.0.0.0 240.0.0.0 在链路上 192.168.56.2 281
224.0.0.0 240.0.0.0 在链路上 192.168.204.177 291
224.0.0.0 240.0.0.0 在链路上 192.168.200.4 281
255.255.255.255 255.255.255.255 在链路上 127.0.0.1 331
255.255.255.255 255.255.255.255 在链路上 169.168.56.1 281
255.255.255.255 255.255.255.255 在链路上 192.168.0.2 281
255.255.255.255 255.255.255.255 在链路上 192.168.20.1 291
255.255.255.255 255.255.255.255 在链路上 192.168.10.1 291
255.255.255.255 255.255.255.255 在链路上 192.168.56.2 281
255.255.255.255 255.255.255.255 在链路上 192.168.204.177 291
255.255.255.255 255.255.255.255 在链路上 192.168.200.4 281