场景:一台星网锐捷RSR20系列路由器,上行千兆口接入到运营商网络,下行24个百兆口接若干计算机,计算机通过路由器获取到私有IP地址,在路由器中转换为运营商分配的公有IP地址,实现上网功能。
配置上行端口(端口配置模式)
ip address 公有IP地址 255.255.255.0
ip nat outside
创建VLAN10并为VLAN配置私有IP地址,作为地址池网关(端口配置模式)
ip address 192.168.6.1 255.255.255.0
配置访问控制列表(全局配置模式)
access-list 1 permit 192.168.6.0 0.0.0.255
配置PAT(全局配置模式)
ip nat inside source list 1 pool nat-pool overload
ip nat pool nat-pool 公有IP地址 公有IP地址 netmask 255.255.255.0
配置DHCP(全局配置模式)
service dhcp(打开dhcp功能)
no ip dhcp confliclogging(关闭dhcp日志记录)
ip dhcp pool cisco(配置dhcp服务器的名称为cisco)
(dhcp配置模式)
(dhcp-config)#network 192.168.6.0 255.255.255.0(配置dhc
配置上行端口(端口配置模式)
ip address 公有IP地址 255.255.255.0
ip nat outside
创建VLAN10并为VLAN配置私有IP地址,作为地址池网关(端口配置模式)
ip address 192.168.6.1 255.255.255.0
配置访问控制列表(全局配置模式)
access-list 1 permit 192.168.6.0 0.0.0.255
配置PAT(全局配置模式)
ip nat inside source list 1 pool nat-pool overload
ip nat pool nat-pool 公有IP地址 公有IP地址 netmask 255.255.255.0
配置DHCP(全局配置模式)
service dhcp(打开dhcp功能)
no ip dhcp confliclogging(关闭dhcp日志记录)
ip dhcp pool cisco(配置dhcp服务器的名称为cisco)
(dhcp配置模式)
(dhcp-config)#network 192.168.6.0 255.255.255.0(配置dhc