|
interface fastethernet0/0
ip address 10.18.100.1 255.255.0.0 //指定局域网口的IP地址
duplex auto
speed auto
ip nat inside //指定局域网接口
!
interface fastethernet0/1
ip address 211.82.220.129 255.255.255.248 //指定广域网口的IP地址
duplex auto
speed auto
ip nat outside //指定广域网口的IP地址
!
access-list 1 permit 192.168.1.0 0.0.0.255 //定义本地访问列表1
ip nat pool everyone 211.82.220.130 211.82.220.130 netmask 255.255.255.252
//定义合法IP地址池,名称为everyone
ip nat inside source list1 pool everyone overload //启用端口复用地址转换
ip nat inside source static tcp 192.168.1.11 80 202.99.160.130 80
//定义Web服务至192.168.1.11
ip nat inside source static tcp 192.168.1.12 21 202.99.160.130 21
//定义FTP服务至192.168.1.12
ip nat inside source static tcp 192.168.1.13 25 202.99.160.130 25
//定义POP3服务至192.168.1.13
ip nat inside source static tcp 192.168.1.13 110 202.99.160.130 110
//定义SMTP服务至192.168.1.13,POP3和SMTP服务使用同一服务器
或者
interface fastethernet0/0
ip address 10.18.100.1 255.255.0.0
duplex auto
speed auto
ip nat inside
!
interface fastethernet0/1
ip address 211.82.220.129 255.255.255.248
duplex auto
speed auto
ip nat outside
access-list 1 permit 192.168.1.0 0.0.0.255
!
ip nat inside source list1 interface fastethernet0/1 overload
//启用端口复用地址转换,并直接采用fastethernet0/1的IP地址
ip nat inside source static tcp 192.168.1.11 80 202.99.160.129 80
ip nat inside source static tcp 192.168.1.12 21 202.99.160.129 21
ip nat inside source static tcp 192.168.1.13 25 202.99.160.129 25
ip nat inside source static tcp 192.168.1.13 110 202.99.160.129 110
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/262387/viewspace-1015930/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/262387/viewspace-1015930/