思科NAT配置
静态NAT(主要用于外网访问内网服务器)
ip nat inside source static 192.168.1.1 100.1.1.1 //外网地址100.1.1.1转换为内网地址192.168.1.1
ip nat inside source static tcp 192.168.1.1 80 100.1.1.1 80
int f0/0 //内网接口下
ip nat inside
int f0/1 //外网接口下
ip nat outside
动态NAT(先设置地址池,然后匹配ACL)
ip nat pool AAA 100.1.1.1 100.1.1.10 netmask 255.255.255.0 //注意是外网的地址池
access-list 1 permit 192.168.1.0 0.0.0.255 //允许192.168.1.0网段的地址访问
int f0/0 //内网接口下
ip nat inside
int f0/1 //外网接口下
ip nat outside
ip nat inside source access-list 1 pool AAA //执行NAT
PNAT(基于接口)
access-list 1 permit 192.168.1.0 0.0.0.255 //允许192.168.1.0网段的地址访问
int f0/0 //内网接口下
ip nat inside
int f0/1 //外网接口下
ip nat outside
ip nat inside source list 1 int f1/0 overload //f1/0为外网接口
华为NAT配置
静态NAT
int f1/0 //直接在外