作用
nat server功能使得内部服务器可以供外部网络访问。**外部网络的用户访问内部服务器时,nat将请求报文的目的地址转换成内部服务器的私有地址。对内部服务器回应报文而言,nat还会自动将回应报文的源地址(私网地址)转换成公网地址。
实验拓扑
AR1
<Huawei>sys
[Huawei]un in en
[Huawei]sys AR1
[AR1]int g0/0/0
[AR1-GigabitEthernet0/0/0]
[AR1-GigabitEthernet0/0/0]ip add 192.168.1.2 24
[AR1-GigabitEthernet0/0/0]q
[AR1]int g4/0/0
[AR1-GigabitEthernet4/0/0]ip add 100.100.100.1 24
[AR1-GigabitEthernet4/0/0]q
[AR1]ip route-static 0.0.0.0 0 100.100.100.2
[AR1]acl 2000
[AR1-acl-basic-2000]rule 5 permit source 192.168.1.0 0.0.0.255
[AR1-acl-basic-2000]int g4/0/0
[AR1-GigabitEthernet4/0/0]nat outbound 2000
[AR1-GigabitEthernet4/0/0]q
[AR1]int g4/0/0
[AR1-GigabitEthernet4/0/0]
[AR1-GigabitEthernet4/0/0]nat server protocol tcp global 100.100.100.3 80 inside
192.168.1.1 80
[AR1-GigabitEthernet4/0/0]
AR2
<Huawei>sys
[Huawei]un in en
[Huawei]sys AR2
[AR2]int g0/0/0
[AR2-GigabitEthernet0/0/0]ip add 100.100.100.2 24
[AR2-GigabitEthernet0/0/0]q
[AR2]int g0/0/1
[AR2-GigabitEthernet0/0/1]ip add 200.200.200.2 30
[AR2-GigabitEthernet0/0/1]q
[AR2]