首先是enable進入 然后conf t進行配置 找到端口 int vlan 1 no shutdown 設置IP :ip address 192.168.1.2 255.255.255.0 退出至上一層 exit 配置網關 Ip default-gateway 192.168.1.254
Switch>en
Switch>enable
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int vlan 1
Switch(config-if)#no shutdown
Switch(config-if)#ip address 192.168.1.2 255.255.255.0
Switch(config-if)#exit
Switch(config)#ip de
Switch(config)#ip default-gateway 192.168.1.254
Switch(config)#exit
Switch#
%SYS-5-CONFIG_I: Configured from console by console
路由器配置IP
步驟如下 下面使用簡寫,比如en表示enable,conf表示configure ,t表示terminal,當然可以使用tab鍵自動補全 Router> en 進入特權模式 Router# conf t 進入配置模式 Router(config-if)# int 端口號 Router(config-if)# no shutdown Router(config-if)# ip address 192.168.1.1 255.255.255.0 Router(config-if)# exit
Router>enable
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int fa0/0
Router(config-if)#no shutdownRouter(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to upRouter(config-if)#ip address 192.168.1.254 255.255.255.0
Router(config-if)#exit
Router(config)#
Router#
%SYS-5-CONFIG_I: Configured from console by console