三台路由器两台PC的网络配置

目录

一、拓扑图

二、路由器配置

 R0路由器配置

R1路由器配置

R1路由器配置

三、检查路由器未知路由条目

R0路由器

R1路由器

R2路由器

四、添加路由器未知条目

R0路由器

R1路由器

R2路由器

五、调试

PC0到PC1是否能ping通

PC1到PC0是否能ping通


一、拓扑图

二、路由器配置

 R0路由器配置

Router>en(进入特权模式

Router#conf t(进入全局配置模式

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#int f0/1(进入R0路由器的0/1接口

Router(config-if)#ip add(简写按Tab

Router(config-if)#ip address 192.168.1.254 255.255.255.0(对R1路由器0/1接口配置ip地址

Router(config-if)#ex(退出特权、配置模式

Router(config)#int f0/0(继续进入0/0接口

Router(config-if)#ip add

Router(config-if)#ip address 192.168.2.1 255.255.255.0(对R1路由器0/0接口配置ip地址

Router(config-if)#end(返回特权模式

Router#

%SYS-5-CONFIG_I: Configured from console by console

Router#

Router>en

Router#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#int f0/0

Router(config-if)#no shut(激活f0/0接口

Router(config-if)#

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

Router(config-if)#ex

Router(config)#int f0/1

Router(config-if)#no shut(激活f0/1接口

R1路由器配置

Router>en

Router#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#int f0/0

Router(config-if)#ip add

Router(config-if)#ip address 192.168.2.2 255.255.255.0

Router(config-if)#ex

Router(config)#int f0/1

Router(config-if)#ip add

Router(config-if)#ip address 192.168.3.1 255.255.255.0

Router(config-if)#end

Router#

%SYS-5-CONFIG_I: Configured from console by console

Router#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#int f0/1

Router(config-if)#no shut(激活f0/1接口

Router(config-if)#

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

Router(config-if)#ex

Router(config)#int f0/0

Router(config-if)#no shut(激活f0/0接口

Router(config-if)#

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

R1路由器配置

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int f0/0
Router(config-if)#ip add
Router(config-if)#ip address 192.168.3.2 255.255.255.0
Router(config-if)#ex
Router(config)#int f0/1
Router(config-if)#ip add
Router(config-if)#ip address 192.168.4.254 255.255.255.0
Router(config-if)#end
Router#

Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int f0/1
Router(config-if)#no shut(激活f0/1接口

Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

Router(config-if)#ex
    
Router(config)#int f0/0
Router(config-if)#no shut(激活f0/0接口

三、检查路由器未知路由条目

R0路由器

Router(config-if)#end

Router#

%SYS-5-CONFIG_I: Configured from console by console

Router#show ip route(检查路由器R0已知的路由条目

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

* - candidate default, U - per-user static route, o - ODR

P - periodic downloaded static route

Gateway of last resort is not set

C 192.168.1.0/24 is directly connected, FastEthernet0/1(已知条目

C 192.168.2.0/24 is directly connected, FastEthernet0/0(已知条目

R1路由器

Router(config-if)#end

Router#

%SYS-5-CONFIG_I: Configured from console by console

Router#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

* - candidate default, U - per-user static route, o - ODR

P - periodic downloaded static route

Gateway of last resort is not set

C 192.168.2.0/24 is directly connected, FastEthernet0/0(已知条目

C 192.168.3.0/24 is directly connected, FastEthernet0/1(已知条目

R2路由器

Router(config-if)#end

Router#

%SYS-5-CONFIG_I: Configured from console by console

Router#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

* - candidate default, U - per-user static route, o - ODR

P - periodic downloaded static route

Gateway of last resort is not set

C 192.168.3.0/24 is directly connected, FastEthernet0/0(已知条目

C 192.168.4.0/24 is directly connected, FastEthernet0/1(已知条目

四、添加路由器未知条目

R0路由器

Router#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#ip route 192.168.3.0 255.255.255.0 192.168.2.2(添加未知路由条目和下一跳地址

Router(config)#ip route 192.168.4.0 255.255.255.0 192.168.2.2(添加未知路由条目和下一跳地址

Router(config)#ex

Router#

%SYS-5-CONFIG_I: Configured from console by console

Router#

R1路由器

Router#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.1(添加未知路由条目和下一跳地址

Router(config)#ip route 192.168.4.0 255.255.255.0 192.168.3.2(添加未知路由条目和下一跳地址

Router(config)#ex

Router#

%SYS-5-CONFIG_I: Configured from console by console

R2路由器

Router#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.3.1(添加未知路由条目和下一跳地址

Router(config)#ip route 192.168.2.0 255.255.255.0 192.168.3.1(添加未知路由条目和下一跳地址

Router(config)#ex

Router#

五、调试

PC0到PC1是否能ping通

PC1到PC0是否能ping通

  • 6
    点赞
  • 42
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值