新手教程直连路由的配置
如下图:
PC0 IP地址:192.168.1.2 网关:192.168.1.1
PC1 IP地址:192.168.2.2 网关:192.168.2.1
R1 g0/0 IP地址:192.168.1.1
R1 g0/1 IP地址:192.168.2.1
- 单击PC0配置IP地址(PC1同理)
- 配置R1
单击R1,点CLI
输入即可进入普通用户模式
- R1的命令配置
Continue with configuration dialog? [yes/no]: no
Press RETURN to get started!
Router>enab
Router>enable
Router#conf
Router#configure
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int g0/0
#进入路由器g0/0端口设置IP地址
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#no shutdown
#开启端口
Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
#进入路由器g0/1端口设置IP地址
Router(config-if)#int g0/1
Router(config-if)#ip address 192.168.2.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up
Router(config-if)#exit
- 配置完以上命令后 ,你会发现网线的灯变绿,说明可以连通了 PC0能pingPC1