(ftp网站的考虑,提供的IP比较多)
动态地址+端口复用地址转换
网络环境:
2Mb/s DDN专线
2611路由器
内部网络地址:172。16。100。1---172。16。100。254
局域网地址:172。16。100。1 subnet:255.255.0.0
合法地址:202。99。160。128-----202。99。160。191 subnet:255.255.255.192
广域网接口地址:202.99.160.129
可用于转换的地址:202.99.160.130---202.99.160.190
interface fastethernet 0/1
ip address 172.16.100.1 255.255.0.0
duplex auto
speed auto
ip nat inside
interface serial 0/0
ip address 202.99.160.129 255.255.255.192
duplex auto
speed auto
ip nat outside
ip nat pool public 202.99.160.190 202.99.160.190 netmask 255.255.255.192
ip nat pool super 202.99.160.130 202.99.160.189 netmask 255.255.255.192
ip nat inside source list1 pool public
ip nat insice source list2 pool super overload
access-list1 permit 172.16.100.0 0.0.0.255
access-list2 permit 172.16.101.0 0.0.0.255
access-list2 permit 172.16.102.0 0.0.0.255
静态地址+端口复用
网络环境:
局域网采用10M光纤,以城域网接入internet
路由器选用拥有2个10/100M自适应端口的2611
内部地址:10.18.100.1-----10.18.100.254 subnet:255.255.0.0
局域网口地址:10.18.100.1 子网掩码:255.255.0.0
合法IP地址:211.82.220.80----211.82.220.87 子网掩码:255.255.255.248
连接ISP的端口ethernet1的IP地址为211.82.100.81 子网掩码:255.255.255.248
要求:局域网的计算机可以访问internet并且在internet 中提供web,e-mail,ftp,media等到四种服务。
interface fastethernet 0/0
ip address 10.18.100.1 255.255.0.0
dupex auto
speed auto
ip nat inside
interface fastethernet 0/1
ip address 211.82.220.81 255.255.255.248
duplex auto
speed auto
ip nat outside
ip nat pool every 211.82.220.86 211.82.220.86 netmask 255.255.255.248
定义合法的地址池
access-list 1 permit 10.18.101.0 0.0.0.255
access-list 1 permit 10.18.102.0 0.0.0.255
access-list 1 permit 10.18.103.0 0.0.0.255
access-list 1 permit 10.18.104.0 0.0.0.255
ip nat inside source list1 pool every overload
静态转换:
ip nat inside source static 10.18.100.10 211.82.220.82
ip nat inside source static 10.18.100.11 211.82.220.83
ip nat inside source static 10.18.100.12 211.82.220.84
ip nat inside source static 10.18.100.13 211.82.220.85
案例四:tcp/udp nat端口映射
网络环境:
局域网采用10M光纤以城域网方式接入internet
路由器拥有2个10/100M自适应端口的cisco 2611
内部地址:192.168.1.1-----192.168.1.251
局域网端口ethernet0的ip 192.168.1.1 subnet: 255.255.255.0
网络合法地址:211.82.220.128----211.82.220.131
连接ISP的地址:211.82.220.129 子网掩码:255.255.255.252
可用于转换的地址:211.82.220.130
interface fastethernet 0/0
ip address 192.168.1.1 255.255.255.0
duplex auto
speed auto
ip nat inside
interface ethernet 0/1
ip address 211.82.220.129 255.255.255.252
duplex auto
speed auto
ip nat outside
ip nat pool everyone 211.82.220.130 211.82.220.130 netmask 255.255.255.252
access-list 1 permit 192.168.1.0 0.0.0.255
ip nat inside source list1 pool everyone overload
ip nat inside source list1 interface fastethernet 0/1 overload(端口复用直接采用f0/1的地址)
ip nat inside source static tcp 192.168.1.11 80 211.82.220.130 80
ip nat inside source static tcp 192.168.1.12 21 211.82.220.130 21
本文转自 yirehe 51CTO博客,原文链接:http://blog.51cto.com/yirehe/17779,如需转载请自行联系原作者