配置BasicNAT,地址池多的情况下,末尾加上no-pat
nat address-group 1
address 178.76.28.10 178.76.28.15
interface GigabitEthernet0/1
ip address 178.76.28.1 255.255.255.0
nat outbound 2000 address-group 1 no-pat
acl number 2000
rule 0 permit source 10.0.0.0 0.0.0.255
配置NAPT:私网客户端需要访问外网服务器,但由于公网地址有限,在RTA上配置的公网地址池范围198.76.28.11-198.76.28.11,因此配置NAPT,动态为私网客户端分配公网地址和协议。
[R1]int g0/1
[R1-GigabitEthernet0/1]undo nat out 2000
[R1-GigabitEthernet0/1]qui
[R1]undo nat ad
[R1]undo nat address-group 1
[R1]nat address-group 1
[R1-address-group-1]address 178.76.28.3 178.76.28.3
[R1-GigabitEthernet0/1]nat outbound 2000 address-group 1
配置easy Nat:私网客户端需要访问外网服务器Server,使用公网接口IP地址动态为私网客户端分配公网地址和协议端口
[R1]int g0/1
[R1-GigabitEthernet0/1]undo nat out 2000
[R1-GigabitEthernet0/1]qui
[R1]undo nat ad
[R1]undo nat address-group 1
[R1-GigabitEthernet0/1]nat outbound 2000
NATserver配置
int g0/1
nat server protocol tcp global 178.76.28.1 telnet inside
10.0.0.3 telnet
注意:(下面代码不是此实验的,可以借鉴)
[RTA-Ethernet0/1]nat server protocol icmp global 198.76.28.10 inside 10.0.0.1 匹配公网对应的私网地址和所使用的协议。
当公网想要访问内部的私有服务时,同样使用NAT SERVER ,比如FTP,www,DNS等:
RTA]int e0/1
[RTA-Ethernet0/1]nat server protocol tcp global 198.76.28.10 ftp inside 10.0.0.1 ftp
[RTA-Ethernet0/1]nat server protocol tcp global 198.76.28.10 www inside 10.0.0.1 www 文章来源:https://www.toymoban.com/news/detail-483460.html
[RTA-Ethernet0/1]nat server protocol udp global 198.76.28.10 dns inside 10.0.0.1 dns文章来源地址https://www.toymoban.com/news/detail-483460.html
到了这里,关于H3C NAT 地址转换(私网转公网)【basic nat ,napt,easy nat ,nat server】的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!