ensp 静态路由小实验2

要求如图所示,接下来划分ip

首先配置各路由器IP,保证内网连通性

R1:

[r1]int lo0
[r1-LoopBack0]ip add 192.168.1.1 28
[r1-LoopBack0]int lo1
[r1-LoopBack1]ip add 192.168.1.17 28
[r1-LoopBack1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.129 30
[r1-GigabitEthernet0/0/0]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 192.168.1.137 30

R2:
[r2]int lo0
[r2-LoopBack0]ip add 192.168.1.33 28
[r2-LoopBack0]q
[r2]int lo1
[r2-LoopBack1]ip add 192.168.1.49 28
[r2-LoopBack1]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.1.130 30
[r2-GigabitEthernet0/0/0]int g 0/0/1
[r2-GigabitEthernet0/0/1]ip add 192.168.1.133 30

R3:
[r3]int lo0
[r3-LoopBack0]ip add 192.168.1.65 28
[r3-LoopBack0]q
[r3]int lo1
[r3-LoopBack1]ip add 192.168.1.81 28
[r3-LoopBack1]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.1.138 30
[r3-GigabitEthernet0/0/0]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.1.141 30
 

R4:

[r4]int lo0
[r4-LoopBack0]ip add 192.168.1.97 28
[r4-LoopBack0]q
[r4]int lo1
[r4-LoopBack1]ip add 192.168.1.113 28
[r4-LoopBack1]q
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.1.134 30
[r4-GigabitEthernet0/0/0]int g 0/0/1
[r4-GigabitEthernet0/0/1]ip add 192.168.1.142 30
[r4-GigabitEthernet0/0/1]int g 4/0/0
[r4-GigabitEthernet4/0/0]ip add 192.168.1.145 30
[r4-GigabitEthernet4/0/0]int g0/0/2
[r4-GigabitEthernet0/0/2]ip add 192.168.1.149 30

R5:

[r5]int lo0
[r5-LoopBack0]ip add 5.5.5.5 24
[r5-GigabitEthernet0/0/1]ip add 192.168.1.146 30
[r5-GigabitEthernet0/0/0]ip add 192.168.1.150 30
 

配置内网静态路由:

R1:

[r1]ip route-s    
[r1]ip route-static 192.168.1.32 27 192.168.1.130
[r1]ip route-static 192.168.1.132 30 192.168.1.130
[r1]ip route-static 192.168.1.96 27 192.168.1.130
[r1]ip route-static 192.168.1.96 27 192.168.1.138
[r1]ip route-static 192.168.1.140 30 192.168.1.138
[r1]ip route-static 192.168.1.64 27 192.168.1.138

[r1]ip route-static 192.168.1.144 30 192.168.1.138
[r1]ip route-static 192.168.1.144 30 192.168.1.130

R2:

[r2]ip route-static 192.168.1.96 27 192.168.1.134
[r2]ip route-static 192.168.1.140 30 192.168.1.134
[r2]ip route-static 192.168.1.64 27 192.168.1.134
[r2]ip route-static 192.168.1.64 27 192.168.1.129
[r2]ip route-static 192.168.1.136 30 192.168.1.129
[r2]ip route-static 192.168.1.0 27 192.168.1.129

[r2]ip route-static 192.168.1.144 30 192.168.1.134
[r2]ip route-static 192.168.1.148 30 192.168.1.134

R3:

[r3]ip route-static 192.168.1.96 27 192.168.1.142
[r3]ip route-static 192.168.1.132 30 192.168.1.14
[r3]ip route-static 192.168.1.32 27 192.168.1.142
[r3]ip route-static 192.168.1.32 27 192.168.1.137
[r3]ip route-static 192.168.1.128 30 192.168.1.137
[r3]ip route-static 192.168.1.0 27 192.168.1.137

[r3]ip route-static 192.168.1.144 30 192.168.1.142
[r3]ip route-static 192.168.1.148 30 192.168.1.142

R4:

[r4]ip route-static 192.168.1.64 27 192.168.1.141
[r4]ip route-static 192.168.1.136 30 192.168.1.141
[r4]ip route-static 192.168.1.0 27 192.168.1.141
[r4]ip route-static 192.168.1.0 27 192.168.1.133
[r4]ip route-static 192.168.1.128 30 192.168.1.133
[r4]ip route-static 192.168.1.32 27 192.168.1.133

测试内网连通性:

无误

配置缺省路由,连接公网:

[r1]ip route-static 0.0.0.0 0.0.0.0 192.168.1.130
[r1]ip route-static 0.0.0.0 0.0.0.0 192.168.1.138
[r2]ip route-static 0.0.0.0 0.0.0.0 192.168.1.134

[r3]ip route-static 0.0.0.0 0.0.0.0 192.168.1.142

[r4]ip route-static 0.0.0.0 0.0.0.0 192.168.1.146
[r4]ip route-static 0.0.0.0 0.0.0.0 192.168.1.150 preference 61

配置公网与内网间的静态路由:

[r5]ip route-static 192.168.1.96 27 192.168.1.145
[r5]ip route-static 192.168.1.140 30 192.168.1.145
[r5]ip route-static 192.168.1.64 27 192.168.1.145
[r5]ip route-static 192.168.1.136 30 192.168.1.145
[r5]ip route-static 192.168.1.0 27 192.168.1.145
[r5]ip route-static 192.168.1.128 30 192.168.1.145
[r5]ip route-static 192.168.1.32 27 192.168.1.145
[r5]ip route-static 192.168.1.132 30 192.168.1.145

[r5]ip route-static 192.168.1.96 27 192.168.1.149 p61
[r5]ip route-static 192.168.1.140 30 192.168.1.149 p61
[r5]ip route-static 192.168.1.64 27 192.168.1.149 p61
[r5]ip route-static 192.168.1.136 30 192.168.1.149 p61

[r5]ip route-static 192.168.1.0 27 192.168.1.149 p61
[r5]ip route-static 192.168.1.128 30 192.168.1.149p61
[r5]ip route-static 192.168.1.32 27 192.168.1.149 p61
[r5]ip route-static 192.168.1.132 30 192.168.1.149 p61

为防止路由黑洞的出现,在各路由器上配置空接口:

[r1]ip route-static 192.168.1.0 27 NULL 0

[r2]ip route-static 192.168.1.32 27 NULL 0

[r3]ip route-static 192.168.1.64 27 NULL 0

[r4]ip route-static 192.168.1.96 27 NULL 0

测试是否全网可达:

完成小实验 

 

 

 

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值