1、Total interface: 13Name IP Address Zone MAC VLAN State VSDeth1 0.0.0.0/0 Trust 0012.1ea0.0ae0 - D -eth2 192.168.2.1/24 Untrust 0012.1ea0.0ae5 - U -eth3 0.0.0.0/0 Untrust 0012.1ea0.0ae6 - D -eth4 192.168.1.1/24 Trust 0012.1ea0.0ae7 - U -vlan1 0.0.0.0/0 VLAN 0012.1ea0.0aef 1 D -具体操作步骤:1)首先登陆WEB UI,进入N
2、etwork-Interfaces界面:2)选定Untrust区域的网络接口本例是eth2,进入其Basic页面:3)切换至VIP分页,在Virtual IP Address栏输入VIP NAT后的地址(注意:这个地址一定要与你的NAT出口同一网段,但系统默认不支持使用与NAT出口同一地址,具体内容请参照本文最后的“小技巧”部分),本例使用的是192.168.2.3,按Add按钮添加:4)添加完成后可以在主页面偏下方看到我们添加的VIP记录,设置VIP-在主页面右上角有一个New VIP Service的按钮,点击它5)在Virtual IP中选定我们刚新建好的、VIP NAT后的地址;Vir
3、tual Port中输入VIP NAT后的传输层端口;Map to Service是我们需要映射的传输层端口(这个可以在NetScreen设备的Objects-Services-Custom中自行定义);Map to IP中输入我们要映射的主机IP地址;Server Auto Detection用于防火墙以PING的方式检测该Map to IP的主机是否存在的功能(作用不大);按OK按钮进入下一步操作6)现在我们回到VIP的主界面后就可以观赏到一条完整的VIP记录了:7)建立了VIP后需要定义一条策略使其生效,进入Policies页面,建立一条Untrust到Global的策略:Source
4、Address=Any;Destination Address=VIP(192.168.2.3);Service=Any;Application=None;Action=Permit;(忽略其它通用的选项)8)建立后我们可以在Policies主界面看到该策略:9)现在我们重新回到eth2的VIP界面,可以看到我们原来新建的那条VIP记录的Status了吧?J下面提供一个我在项目实施中的具体案例:拓扑:cfg配置:set clock timezone 0set vrouter trust-vr sharableunset vrouter trust-vr auto-route-exportset
5、 service 20 protocol tcp src-port 0-65535 dst-port 20-20 21 protocol tcp src-port 0-65535 dst-port 21-21 8023 protocol tcp src-port 0-65535 dst-port 8023-8023 80 protocol tcp src-port 0-65535 dst-port 80-80 + udp src-port 0-65535 dst-port 80-80 6633 protocol tcp src-port 0-65535 dst-port 6633-6633 +
6、 udp src-port 0-65535 dst-port 6633-6633 1554 protocol tcp src-port 0-65535 dst-port 1554-1554 + udp src-port 0-65535 dst-port 1554-1554 3389 protocol tcp src-port 0-65535 dst-port 3389-3389 + udp src-port 0-65535 dst-port 3389-3389 set auth-server Local id 0 server-name set auth default auth server
7、 set admin name netscreenset admin password nKVUM2rwMUzPcrkG5sWIHdCtqkAibnset admin auth timeout 10set admin auth server set admin format dosset zone Trust vrouter UntrustDMZVLAN tcp-rst block unset zone MGT screen tear-drop screen syn-flood screen ping-death screen ip-filter-src screen landV1-Untru
8、stset interface ethernet1 zone ethernet2ethernet3ethernet4unset interface vlan1 ipset interface ethernet1 ip 211.139.236.75/29set interface ethernet1 routeset interface ethernet2 ip 10.250.188.141/24set interface ethernet2 natset interface ethernet4 ip 9.9.9.9/24set interface ethernet4 routeunset in
9、terface vlan1 bypass-others-ipsecunset interface vlan1 bypass-non-ipset interface ethernet1 ip manageableset interface ethernet2 ip manageableset interface ethernet1 manage pingunset interface ethernet2 manage snmpunset interface ethernet2 manage sslset interface ethernet1 vip 211.139.236.78 80 HTTP
10、 10.250.188.11set interface ethernet1 vip 211.139.236.78 + 20 set interface ethernet1 vip 211.139.236.78 + 21 set interface ethernet1 vip 211.139.236.78 + 8023 set interface ethernet1 vip 211.139.236.78 + 6633 set interface ethernet1 vip 211.139.236.78 + 1554 10.250.188.12set interface ethernet1 vip
11、 211.139.236.78 + 3389 10.250.188.10set hostname ns204set ike respond-bad-spi 1set policy id 3 from to AnyVIP(211.139.236.78)ANY permit log set policy id 3 disableset policy id 1 from set policy id 2 from Globalset pki authority default scep mode autoset pki x509 default cert-path partialset log mod
12、ule system level emergency destination consoleset log module system level alert destination consoleset log module system level critical destination consoleset log module system level error destination consoleset log module system level warning destination consoleset log module system level notificat
13、ion destination consoleset log module system level information destination consoleset log module system level debugging destination consoleset log module system level error destination webtrendsset log module system level warning destination webtrendsset log module system level information destinati
14、on webtrendsset log module system level debugging destination webtrendsset firewall log-selfset ssh version v2set config lock timeout 5set snmp port listen 161set snmp port trap 162set vrouter untrust-vrexitunset add-default-routeset route 0.0.0.0/0 interface ethernet1 gateway 211.139.236.73*小技巧正常来讲
15、,NetScreen防火墙的中高端型号(NS204或以上)是不支持将VIP映射后的IP地址绑定在该接口的物理接口IP上的(只允许与该IP同一网段),但最近一次偶然的机会让我和我的同事发现到就算是中高端型号的设备也能达成这样的效果:打个比方,我们的需求是将内网的192.168.1.2的TCP80端口映射到防火墙外网接口192.168.2.1的TCP80端口,首先我们将防火墙的外网接口设置为192.168.2.2(与192.168.2.1同一网段,让VIP绑定在192.168.2.1能顺利进行),然后设置该接口的VIP-将192.168.1.2的TCP80端口映射到192.168.2.1的TCP80端口,保存这些设置后重新进入外网接口的设置界面,将其IP修改为192.168.2.1,再次保存整个过程完成。
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1