Cisco路由器上做NAT和DHCP
要在路由器上做NAT,并且配置DHCP的命令
//配置DHCP
ip dhcp excluded-address 192.168.1.1 192.168.1.100
!
ip dhcp pool office
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1
dns-server 8.8.8.8 8.8.4.4
//配置NAT
//外部地址
int fa0/0
ip add 1.1.1.2 255.255.255.248
ip nat outside
//内部地址
int fa0/1
ip add 192.168.1.1 255.255.255.0
ip nat inside
//路由
ip route 0.0.0.0 0.0.0.0 1.1.1.1
//NAT转换
ip nat pool Net 1.1.1.2 1.1.1.7 netmask 255.255.255.248
ip nat inside source list 1 pool Net overload
!
access-list 1 permit 192.168.1.0 0.0.0.255
//端口映射
ip nat inside source static tcp 192.168.1.8 80 1.1.1.6 80