路由汇总及默认路由

一:建立拓扑图并对路由接口进行配置。

  • 建立拓扑图:

  • 对R1路由进行配置

Router>enable

Router#conf t

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

Router(config)#hostname R1

R1(config)#interface GigabitEthernet 0/0

R1(config-if)#ip address 192.168.1.254 255.255.255.0

R1(config-if)#no shutdown

R1(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

R1(config-if)#exit

R1(config)#interface Gigab

R1(config)#interface GigabitEthernet 0/1

R1(config-if)#ip address 12.12.12.1 255.255.255.0

R1(config-if)#no shutdown

R1(config-if)#

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

  • 对R2路由进行配置

R2(config)#interface GigabitEthernet 0/0

R2(config-if)#ip address 76.12.16.133 255.255.255.252

R2(config-if)#no shutdown

R2(config-if)#exit

R2(config)#interface GigabitEthernet0/0

R2(config-if)#exit

R2(config)#interface GigabitEthernet0/1

R2(config-if)#ip address 12.12.12.2 255.255.255.0

R2(config-if)#no shutdown

R2(config-if)#

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

  • 对R2路由进行配置

Router>enable

Router#conf t

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

Router(config)#hostname R3

R3(config)#interface GigabitEthernet 0/0

R3(config-if)#ip address 76.12.16.134 255.255.255.252

R3(config-if)#no shutdown

R3(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

R3(config-if)#exit

R3(config)#interface GI

R3(config)#interface GIgabitEthernet 0/1

R3(config-if)#ip address 76.12.32.254 255.255.255.0

R3(config-if)#no shutdown

R3(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

R3(config-if)#exit

R3(config)#interface GIgabitEthernet 0/2

R3(config-if)#ip address 76.12.96.254 255.255.255.0

R3(config-if)#no shutdown

R3(config-if)#

%LINK-5-CHANGED: Interface GigabitEthernet0/2, changed state to up

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

可观察得拓扑线路已连通:

二.验证pc与路由间的通信。

①首先为PC0 PC1 PC2 配置IP地址、子网掩码和默认网关。

  

验证PC0到R3互连接口的通信,验证PC0到R3互连接口的通信

验证PC0到R3互连接口的通信,验证PC0到R3互连接口的通信,验证PC0到R3互连接口的通信。

②pc之间的通信:

PC0:

PC1:

PC2:

②路由器间的通信:

在R1上:

Ping R2

在R2上:

PingR3

③pc与路由器之间的通信:

PC2去ping PC1和PC0,结果如图所示

  • 在R1上配置路由汇总,R3上配置缺省路由

R1上配置:

R1>enable

R1#conf t

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

R1(config)#ip route 76.12.0.0 255.255.0.0 12.12.12.2

R3上配置:

R3>enable

R3#conf t

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

R3(config)#ip route 0.0.0.0 0.0.0.0 76.12.16.133

  • 在R2上配置静态路由

R2上配置:

R2>

R2>enable

R2#conf t

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

R2(config)#ip route 76.12.32.0 255.255.255.0 76.12.16.134

R2(config)#ip route 76.12.96.0 255.255.255.0 76.12.16.134

R2(config)#ip route 192.168.1.0 255.255.255.0 12.12.12.1

  • 查看三台路由器上的路由信息:

R1:

R2:

R3:

  •  PC2与PC1、PC0互相ping测试

PC2:

PC1:

PC0:

和R3可用。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值