PAT
配置示例<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Router>en
Router#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int ser1
Router(config-if)#exit
Router(config)#no ip domain-lo
Router(config)#line c 0
Router(config-line)#logg syn
Router(config-line)#exec-t 0 0
Router(config-line)#exit
Router(config)#int ser1
Router(config-if)#ip add 100.0.0.1 255.255.255.0
Router(config-if)#ip nat outside
Router(config-if)#ip access-group 1 out
Router(config-if)#no shut
Router(config-if)#exit
Router(config)#int e0
Router(config-if)#ip add 192.168.1.1 255.255.255.0
Router(config-if)#ip nat inside
Router(config-if)#no shut
Router(config-if)#exit
Router(config)#ip nat inside source list 1 pool ds1 overload
(其中ip nat inside source list X pool xx overload为关键字)
Router(config)#access-list 1 permit 192.168.0.1 255.255.0.0
(设置访问列表,允许内部的网络转换出去,网段自由设顶)
Router(config)#ip nat pool ds1 100.0.0.1 100.0.0.2 netmask 255.255.255.0
(这里的IP为能在公网上使用的IP,这里设置了2个IP,可以为几个, 如果后面设置为10。0。0。5,那么这里就有5个公网IP,一般2个就够了)
Router(config)#exit
|
转载于:https://blog.51cto.com/xxgbblog/48454