实验要求:使用防火墙,使内网中的PC自动获得IP地址,而且经过NAT转换,使内网内的主机能够正常访问因特网。
实验设备:H3C防火墙
拓扑图:

由于网络环境是处于局域网(192.168.102.0/24)内,局域网内用户可以访问Internet,因此使用192.168.102.0/24网段模拟因特网。
配置防火墙:
interface Ethernet0/0
ip address 192.168.30.1 24
quit
interface Ethernet0/4
ip address 192.168.102.84 24
quit
ip route-static 0.0.0.0 0.0.0.0 192.168.102.1
firewall zone trust 建立可信任域
add interface Ethernet 0/0 加入可信任域
add interface Ethernet 0/4
dns server 211.138.24.66
dns resolve
rule 10 permit source any
number 2000 match-order auto
nat address-group 1 192.168.102.84 192.168.102.84
int Ethernet0/4
nat outbound 2000
dhcp enable
dhcp server ip-pool aaa
network 192.168.30.0
gateway-list 192.168.30.1
dns-list 211.138.24.66
打开PC,自动获得IP地址,访问因特网,成功访问百度。


如果外网用户需要访问内网,则需要进行DNAT设置,如下:
int Ethernet 0/4
nat server protocol tcp global 192.168.102.84 3389 inside 192.168.30.1 3389
本文出自 “王超峰的博客” 博客