我写的不是很完整,希望大家谅解。我想懂得一点CCNA的知识的朋友会看懂的
地址转换
1:缓存转换(应用层)比如HTTP;FTP
2:NAT地址转换(网络层)
把私有地址转换成公网地址转换叫做SNAT(源地址转换)
把公网地址转换成私有地址转换叫做DNAT(目的地址转换)
分为静态地址转换NAT,也就是说一个私有的转换一个合法的公网地址
routeA#config terminal
route(config)#interface serial 0
routeA(config-if)#ip nat outside
routeA(config-if)#no shutdown
routeA(config-if)#ip address 202.101.11.1 255.255.255.0
routeA(config-if)#exit
route(config)#interface ethernet 0
routeA(config-if)#ip address 192.168.0.2 255.255.255.0
routeA(config-if)#ip nat inside
routeA(config-if)#no shutdown
routeA(config-if)#exit
route(config)#ip nat inside soure static 192.168.0.2 202.101.11.1
内部转换地址池
routeA#config terminal
route(config)#interface serial 0
routeA(config-if)#ip nat outside
routeA(config-if)#no shutdown
routeA(config-if)#ip address 202.101.11.1 255.255.255.0
routeA(config-if)#exit
route(config)#interface ethernet 0
routeA(config-if)#ip address 192.168.0.2 255.255.255.0
routeA(config-if)#ip nat inside
routeA(config-if)#no shutdown
routeA(config-if)#exit
route(config)#access-list 1 permit 192.168.0.0 0.0.0.255
route(config)#ip nat pool yirehe 202.101.11.2 202.101.11.25 netmask 255.255.255.0
route(config)#ip nat inside source list 1 pool yirehe
pat转换端口复用 一个公网的IP地址换多私网IP地址
routeA#config terminal
route(config)#interface serial 0
routeA(config-if)#ip nat outside
routeA(config-if)#no shutdown
routeA(config-if)#ip address 202.101.11.1 255.255.255.0
routeA(config-if)#exit
route(config)#interface ethernet 0
routeA(config-if)#ip address 192.168.0.2 255.255.255.0
routeA(config-if)#ip nat inside
routeA(config-if)#no shutdown
routeA(config-if)#exit
route(config)#access-list 1 permit 192.168.0.0 0.0.0.255
route(config)#ip nat pool yirehe 202.101.11.2 202.101.11.2 netmask 255.255.255.0
route(config)#ip nat inside source list 1 pool yirehe overload
让互联网访问本地
routeA#config terminal
route(config)#interface serial 0
routeA(config-if)#ip nat outside
routeA(config-if)#no shutdown
routeA(config-if)#ip address 202.101.11.1 255.255.255.0
routeA(config-if)#exit
route(config)#interface ethernet 0
routeA(config-if)#ip address 192.168.0.2 255.255.255.0
routeA(config-if)#ip nat inside
routeA(config-if)#no shutdown
routeA(config-if)#exit
route(config)#access-list 1 permit any
route(config)#ip nat pool yirehe 192.168.0.3 192.168.0.5 prefix-length 24 type rotary(启动负载平衡)
route(config)#ip nat inside destination list 1 pool yirehe
发布服务器
例如:内部地址192.168.1.1-192.168.1.251
在路由器上E0:192.168.1.1 subnet:255.255.255.0
网络合法地址:202.101.10.1-202.101.10.4
连接ISP的地址:202.101.10.2 subnet:255.255.255.0
可用的转换的地址为:202.101.10.3 subnet: 255.255.255.0
在2600的路由上做
routeA#config terminal
route(config)#interface fastethernet 0/2
routeA(config-if)#ip address 192.168.1.1 255.255.255.0
routeA(config-if)#ip nat inside
routeA(config-if)#duplex auto
routeA(config-if)#speed auto
routeA(config-if)#no shutdown
routeA(config-if)#exit
route(config)#interface fastethernet 0/1
routeA(config-if)#ip address 202.101.10.2 255.255.255.0
routeA(config-if)#ip nat outside
routeA(config-if)#duplex auto
routeA(config-if)#speed auto
routeA(config-if)#no shutdown
routeA(config-if)#exit
route(config)#access-list 1 permit 192.168.1.0 255.255.255.0
route(config)#ip nat pool yirehe 202.101.10.3 202.101.10.3 netmask 255.255.255.0
route(config)#ip nat inside source list 1 pool yirehe overload
route(config)#ip nat inside source list1 interface fastethernet 0/1
route(config)#ip nat inside source static tcp 192.168.1.11 25 202.101.10.3 25
route(config)#ip nat inside source static tcp 192.168.1.11 110 202.101.10.3 110
route(config)#ip nat inside source static tcp 192.168.1.11 143 202.101.10.3 143