router(config)#ip dhcp pool 1 開啟DHCP功能
Router(dhcp-config)#network 192.168.2.0 255.255.254.0
Router(dhcp-config)#default-router 192.168.2.1
Router(dhcp-config)#dns-server 202.100.96.68 222.75.152.129
router(config)#interface FastEthernet0/0 配置公網介面
router(config-if)#ip address 124.224.177.x 255.x.x.x 配置運營商提供的ip地址及掩碼
router(config-if)#ip nat outside
router(config-if)#no shudown
router(config)#interface FastEthernet0/1 配置內網介面
router(config-if)#ip address 192.168.2.1 255.255.254.0
router(config-if)#ip nat inside
router(config-if)#no shutdown
router(config)#ip route 0.0.0.0 0.0.0.0 124.224.177.xxx 配置路由124.224.177.xxx為運營商提供的閘道器IP
router(config)#access-list 101 permit ip any any 配置訪問控制列表,執行訪問公網的ip段
router(config)#ip nat inside source list 101 interface FastEthernet0/0 overload 配置nat轉換
router(config)#ip dhcp pool 1 開啟DHCP功能
Router(dhcp-config)#network 192.168.2.0 255.255.254.0
Router(dhcp-config)#default-router 192.168.2.1
Router(dhcp-config)#dns-server 202.100.96.68 222.75.152.129
router(config)#interface FastEthernet0/0 配置公網介面
router(config-if)#ip address 124.224.177.x 255.x.x.x 配置運營商提供的ip地址及掩碼
router(config-if)#ip nat outside
router(config-if)#no shudown
router(config)#interface FastEthernet0/1 配置內網介面
router(config-if)#ip address 192.168.2.1 255.255.254.0
router(config-if)#ip nat inside
router(config-if)#no shutdown
router(config)#ip route 0.0.0.0 0.0.0.0 124.224.177.xxx 配置路由124.224.177.xxx為運營商提供的閘道器IP
router(config)#access-list 101 permit ip any any 配置訪問控制列表,執行訪問公網的ip段
router(config)#ip nat inside source list 101 interface FastEthernet0/0 overload 配置nat轉換