CISCO路由器配置静态IP
开启并配置DHCP服务
Router>en
Router#
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#service dhcp(开启DHCP服务)
Router(config)#ip dhcp pool 192.168.1.0/24
Router(dhcp-config)#network 192.168.1.0 255.255.255.0
% A pool already exists for network 192.168.1.0 / 255.255.255.0.
Router(dhcp-config)#default-router 192.168.1.1
Router(dhcp-config)#exit
Router(config)#ip dhcp excluded-address 192.168.1.1 192.168.1.99
Router(config)#end
Router#
Router#
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ip dhcp pool 1
Router(dhcp-config)#network 192.168.1.0 255.255.255.0
% A pool already exists for network 192.168.1.0 / 255.255.255.0.
Router(dhcp-config)#dns-server 202.106.0.20 202.106.46.151
Router(dhcp-config)#default-router 192.168.1.1
Router(dhcp-config)#exit
Router(config)#
Router#
配置外网口(即进线口)静态IP
Router#
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface f0/0
Router(config-if)#ip address 192.168.0.105 255.255.255.0
Router(config-if)#ip nat outside
Router(config-if)#duplex auto
Router(config-if)#speed auto
Router(config-if)#end
Router#
*Mar 1 00:42:59.931: %SYS-5-CONFIG_I: Configured from console by console
Router#
Router#
Router#write(保存配置)
Building configuration...
[OK]
Router#
Router#
*Mar 1 00:30:33.579: %SYS-5-CONFIG_I: Configured from console by console
Router#
配置内网口(即出线口)
Router#
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface e1/0
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#ip nat inside
Router(config-if)#duplex auto
^
% Invalid input detected at '^' marker.
Router(config-if)#speed auto
^
% Invalid input detected at '^' marker.
Router(config-if)#end
Router#
Router#write(保存配置)
Building configuration...
[OK]
Router#
Router#
*Mar 1 00:33:15.087: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet1/
0, changed state to up
Router# |