VPCS> ip ? address [mask] [gateway] address [gateway] [mask]
VPCS> ip 192.168.10.99 255.255.255.0 192.168.10.254 Checking for duplicate address... VPCS : 192.168.10.99 255.255.255.0 gateway 192.168.10.254
VPCS> show ip
NAME : VPCS[1] IP/MASK : 192.168.10.99/24 GATEWAY : 192.168.10.254 DNS : MAC : 00:50:79:66:68:09 LPORT : 20000 RHOST:PORT : 127.0.0.1:30000 MTU : 1500
Switch
Router
1、User EXEC mode
1 2 3 4 5 6 7 8 9 10 11
Router>show ip int b ## show ip information Interface IP-Address OK? Method Status Protocol GigabitEthernet0/0 unassigned YES unset administratively down down GigabitEthernet0/1 unassigned YES unset administratively down down GigabitEthernet0/2 unassigned YES unset administratively down down GigabitEthernet0/3 unassigned YES unset administratively down down
show running-config:显示当前运行的配置。 show interface:显示接口状态和配置。 show ip route:显示IP路由表。 show version:显示设备的软件版本和硬件信息
2、Privileged EXEC mode
1 2 3 4
Router>enable## To Privileged EXEC mode
Router#show running-config ## show run Building configuration...
Router#config ### from Privileged EXEC mode to Global Configuration mode Configuring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z.
### set host name Router(config)#hostname bkfishroute bkfishroute(config)#
### set enable password bkfishroute(config)#enable secret bkfish bkfishroute(config)#end bkfishroute#write
### set interface ip bkfishroute(config)#interface GigabitEthernet0/0 bkfishroute(config-if)#ip address 192.168.101.254 255.255.255.0 bkfishroute(config-if)#no shutdown bkfishroute(config-if)#clock rate 64000 bkfishroute(config-if)#end bkfishroute#write Building configuration... [OK]
### set the next-hop network bkfishroute(config)#ip route 192.168.102.0 255.255.255.0 192.168.10.20 bkfishroute(config)#end bkfishroute#write Building configuration... [OK]