pat
基于端口的NAT
Router 0: Router>enable Router#configure terminal Router(config)#interface fastEthernet 0/0 Router(config-if)#ip address 192.168.1.1 255.255.255.0 Router(config-if)#no shutdown Router(config)#interface fastEthernet 0/1 Router(config-if)#ip address 192.168.2.1 255.255.255.0 Router(config-if)#no shutdown Router(config-if)#ip route 0.0.0.0 0.0.0.0 fastEther 0/1 Router(config)#access-list 1 permit any Router(config)#ip nat inside source list 1 interface fastEthernet 0/1 overload Router(config)#interface fastEthernet 0/1 Router(config-if)#ip nat outside Router(config-if)#interface fastEthernet 0/0 Router(config-if)#ip nat inside Router 1: Router>enable Router#configure terminal Router(config)#interface fastEthernet 0/0 Router(config-if)#ip address 192.168.2.2 255.255.255.0 Router(config-if)#no shutdown Router(config-if)#exit Router(config)#interface fastEthernet 0/1 Router(config-if)#ip address 192.168.3.1 255.255.255.0 Router(config-if)#no shutdown
PAT(多对一)
#access-list 1 permit any(标准型控制列表1准许所有通过) #ip nat inside source list 1 infterface fastEthernet 0/1 overload(设置PAT+过载设置) #ip route 0.0.0.0 0.0.0.0 f0/1(设置为默认路由器) #in f0/0 #ip nat inside(设置f0/0为内网) #in f0/1 #ip nat outside(设置f0/1为外网)
作者:无荨
-------------------------------------------
个性签名:学IT,就要做到‘活到老学到老’!
如果觉得这篇文章对你有小小的帮助的话,别忘记点个“推荐”哦!