现在使用光纤的用户运营商一般会给用户两种地址,互联地址和用户地址。互联地址就是用户和运营商连通的地址需要配置在用户的网关上,一般是路由器。用户地址运营商一般会给一个地址段供用户自己使用。
路由器上的配置方法:
假如运营商给我的互联地址是55.55.66.110 用户地址是55.55.68.228/30
Cisco:
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 55.55.66.110 255.255.255.252
ip nat outside
duplex auto
speed auto
!
ip nat pool useraddress 55.55.68.228 55.55.68.231 netmask 255.255.255.252
ip nat inside source static tcp 192.168.1.254 80 60.29.68.228 80
华为:
#
nat address-group 0 55.55.68.228 55.55.68.231
#
interface Ethernet1/0
ip address 192.168.1.1 255.255.255.0
#
interface Ethernet2/0
description MAIN
ip address 55.55.66.110 255.255.255.252
nat outbound 3001
nat server protocol tcp global 55.55.66.229 80 inside 192.168.1.254 80