网络基础(五)------静态路由--实操

 问题描述:

 一.划分子网

从图可知,一共需要14个网段,包括6个骨干链路和8个环回接口。

在192.168.1.0/24上进行子网划分,划分如下:

借三位,得到8个网段

(一)192.168.1.000 00000/27         骨干链路---------再借三位得到每个骨干链路包含的接口

        192.168.1.000000 00/30    ------192.168.1.0/30

        192.168.1.000001 00/30    ------192.168.1.4/30

        192.168.1.000010 00/30    ------192.168.1.8/30

        192.168.1.000011 00/30    ------192.168.1.12/30

        192.168.1.000100 00/30    ------192.168.1.16/30

        192.168.1.000101 00/30    ------192.168.1.20/30

        // 192.168.1.000110 00/30

        // 192.168.1.000111 00/30

这个色代表的是192.168.1.0/24划分出来的8个这个色代表的是骨干链路划分出来的8个这个色代表划分出来但未使用的

再借一位得到每个路由器的环回接口:

(二)192.168.1.001 00000/27          AR1的环回接口------192.168.1.32/27

192.168.1.0010 0000/28--------------192.168.1.32/28

192.168.1.0011 0000/28---------------192.168.1.64/28

(三)192.168.1.010 00000/27          AR2的环回接口------192.168.1.64/27

192.168.1.0100 0000/28 ---------192.168.1.64/28

192.168.1.0100 0000/28----------192.168.1.80/28

(四)192.168.1.011 00000/27          A R3的环回接口-------192.168.1.96/27

192.168.1.0110 0000/28-----------192.168.1.96/28

192.168.1.0110 0000/28-----------192.168.1.112/28

(五)192.168.1.100 00000/27          AR4的环回接口--------192.168.1.128/27

192.168.1.1000 0000/28-----------192.168.1.128/28

192.168.1.1000 0000/28-----------192.168.1.144/28

// (六)192.168.1.101 00000/27        

// (七)192.168.1.110 00000/27

// (八)192.168.1.111 00000/27

二.配置IP和环回地址

 AR1

[Huawei]int g 0/0/0
[Huawei-GigabitEthernet0/0/0]ip add	
[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.1 30
[Huawei-GigabitEthernet0/0/0]
Sep 11 2021 20:43:51-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
 IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
[Huawei-GigabitEthernet0/0/0]int g 0/0/1
[Huawei-GigabitEthernet0/0/1]ip add	
[Huawei-GigabitEthernet0/0/1]ip address 192.168.1.5 30
[Huawei-GigabitEthernet0/0/1]
Sep 11 2021 20:44:16-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol
 IP on the interface GigabitEthernet0/0/1 has entered the UP state. 
[Huawei-GigabitEthernet0/0/1]q
[Huawei]int l0
[Huawei-LoopBack0]ip add	
[Huawei-LoopBack0]ip address 192.168.1.33 28
[Huawei-LoopBack0]int l1
[Huawei-LoopBack1]ip add 192.168.1.49 28
pback
(s): spoofing
The number of interface that is UP in Physical is 5
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 5
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.1/30       up         up        
GigabitEthernet0/0/1              192.168.1.5/30       up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         192.168.1.33/28      up         up(s)     
LoopBack1                         192.168.1.49/28      up         up(s)     
NULL0                             unassigned           up         up(s) 

AR2

[Huawei]int g 0/0/0
[Huawei-GigabitEthernet0/0/0]ip add	
[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.2 30
[Huawei-GigabitEthernet0/0/0]
Sep 11 2021 20:50:31-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
 IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
[Huawei-GigabitEthernet0/0/0]int g 0/0/1
[Huawei-GigabitEthernet0/0/1]ip add	
[Huawei-GigabitEthernet0/0/1]ip address 192.168.1.9 30
Sep 11 2021 20:50:53-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol
 IP on the interface GigabitEthernet0/0/1 has entered the UP state. 
[Huawei-GigabitEthernet0/0/1]int l0
[Huawei-LoopBack0]ip add	
[Huawei-LoopBack0]ip address 192.168.1.65 28
[Huawei-LoopBack0]int l1
[Huawei-LoopBack1]ip add 192.168.1.81 28
[Huawei-LoopBack1]dis	
[Huawei-LoopBack1]discard
[Huawei-LoopBack1]display ip in	
[Huawei-LoopBack1]display ip interface b	
[Huawei-LoopBack1]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 5
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 5
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.2/30       up         up        
GigabitEthernet0/0/1              192.168.1.9/30       up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         192.168.1.65/28      up         up(s)     
LoopBack1                         192.168.1.81/28      up         up(s)     
NULL0                             unassigned           up         up(s)  

 AR3

[Huawei]int g 0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.1.6 30
[Huawei-GigabitEthernet0/0/0]
Sep 11 2021 20:54:32-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
 IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
[Huawei-GigabitEthernet0/0/0]int g 0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 192.168.1.13 30
Sep 11 2021 20:54:50-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol
 IP on the interface GigabitEthernet0/0/1 has entered the UP state. 
[Huawei-GigabitEthernet0/0/1]int l0
[Huawei-LoopBack0]ip add 192.168.1.97 28
[Huawei-LoopBack0]int l1
[Huawei-LoopBack1]ip add 192.168.1.113 28
[Huawei-LoopBack1]disp	
[Huawei-LoopBack1]display ip i	
[Huawei-LoopBack1]display ip interface b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 5
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 5
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.6/30       up         up        
GigabitEthernet0/0/1              192.168.1.13/30      up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         192.168.1.97/28      up         up(s)     
LoopBack1                         192.168.1.113/28     up         up(s)     
NULL0                             unassigned           up         up(s) 

AR4

[Huawei]int g 0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.1.14 30
[Huawei-GigabitEthernet0/0/0]
Sep 11 2021 20:57:13-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
 IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
[Huawei-GigabitEthernet0/0/0]int g 0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 192.168.1.10 30
Sep 11 2021 20:57:41-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol
 IP on the interface GigabitEthernet0/0/1 has entered the UP state. 
[Huawei-GigabitEthernet0/0/1]int g 0/0/2
[Huawei-GigabitEthernet0/0/2]ip add 192.168.1.17 30
Sep 11 2021 20:58:20-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[2]:The line protocol
 IP on the interface GigabitEthernet0/0/2 has entered the UP state. 
[Huawei-GigabitEthernet0/0/2]int g 4/0/0
[Huawei-GigabitEthernet4/0/0]ip add 192.168.1.21 30
Sep 11 2021 20:59:20-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[3]:The line protocol
 IP on the interface GigabitEthernet4/0/0 has entered the UP state. 
[Huawei-GigabitEthernet4/0/0]int l0
[Huawei-LoopBack0]ip add 192.168.1.129 28
[Huawei-LoopBack0]int l1
[Huawei-LoopBack1]ip add 192.168.1.145 28
[Huawei-LoopBack1]dis	
[Huawei-LoopBack1]discard
[Huawei-LoopBack1]display ip in	
[Huawei-LoopBack1]display ip interface b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 7
The number of interface that is DOWN in Physical is 3
The number of interface that is UP in Protocol is 7
The number of interface that is DOWN in Protocol is 3

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.14/30      up         up        
GigabitEthernet0/0/1              192.168.1.10/30      up         up        
GigabitEthernet0/0/2              192.168.1.17/30      up         up        
GigabitEthernet4/0/0              192.168.1.21/30      up         up        
GigabitEthernet4/0/1              unassigned           down       down      
GigabitEthernet4/0/2              unassigned           down       down      
GigabitEthernet4/0/3              unassigned           down       down      
LoopBack0                         192.168.1.129/28     up         up(s)     
LoopBack1                         192.168.1.145/28     up         up(s)     
NULL0                             unassigned           up         up(s) 

AR5

[Huawei]int g 0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.1.18 30
Sep 11 2021 21:04:18-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
 IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
[Huawei-GigabitEthernet0/0/0]
[Huawei-GigabitEthernet0/0/0]int g 0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 192.168.1.22 30
Sep 11 2021 21:04:47-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol
 IP on the interface GigabitEthernet0/0/1 has entered the UP state. 
[Huawei-GigabitEthernet0/0/1]int l0
[Huawei-LoopBack0]ip add	
[Huawei-LoopBack0]ip address 5.5.5.5 24
[Huawei-LoopBack0]dis	
[Huawei-LoopBack0]discard
[Huawei-LoopBack0]display ip i	
[Huawei-LoopBack0]display ip interface b	
[Huawei-LoopBack0]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.18/30      up         up        
GigabitEthernet0/0/1              192.168.1.22/30      up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         5.5.5.5/24           up         up(s)     
NULL0                             unassigned           up         up(s) 

三.配置静态路由

AR1

[Huawei]ip route-static 192.168.1.64 27 192.168.1.2
[Huawei]ip ro s	
[Huawei]ip ro	
[Huawei]ip route
[Huawei]ip route-static 192.168.1.8 30 192.168.1.2
[Huawei]ip route-static 192.168.1.128 27 192.168.1.2
[Huawei]ip route-static 192.168.1.128 27 192.168.1.6
[Huawei]
[Huawei]ip route-static 192.168.1.16 30 192.168.1.2
[Huawei]ip route-static 192.168.1.16 30 192.168.1.6
[Huawei]ip route-static 192.168.1.12 30 192.168.1.6
[Huawei]ip route-static 192.168.1.96 27 192.168.1.6

 AR2

[Huawei]ip route-static 192.168.1.128 27 192.168.1.10
[Huawei]ip route-static 192.168.1.16 30 192.168.1.10
[Huawei]ip route-static 192.168.1.12 30 192.168.1.10
[Huawei]ip route-static 192.168.1.96 27 192.168.1.10
[Huawei]ip route-static 192.168.1.96 27 192.168.1.1
[Huawei]ip route-static 192.168.1.4 30 192.168.1.1
[Huawei]ip route-static 192.168.1.32 27 192.168.1.1

AR3

[Huawei]ip route-static 192.168.1.32 27 192.168.1.5
[Huawei]ip route-static 192.168.1.0 27 192.168.1.5
[Huawei]ip route-static 192.168.1.64 27 192.168.1.5
[Huawei]ip route-static 192.168.1.64 27 192.168.1.14
[Huawei]ip route-static 192.168.1.8 27 192.168.1.14
[Huawei]ip route-static 192.168.1.8 30 192.168.1.14
[Huawei]ip route-static 192.168.1.128 27 192.168.1.14
[Huawei]ip route-static 192.168.1.16 30 192.168.1.14

AR4

[Huawei]ip route-static 192.168.1.96 27 192.168.1.13
[Huawei]ip route-static 192.168.1.4 30 192.168.1.13
[Huawei]ip route-static 192.168.1.32 27 192.168.1.9
[Huawei]ip route-static 192.168.1.0 30 192.168.1.9
[Huawei]ip route-static 192.168.1.64 27 192.168.1.9

 AR5

[Huawei]ip route-static 192.168.1.32 27 192.168.1.17    /
[Huawei]ip route-static 192.168.1.64 27 192.168.1.17
[Huawei]ip route-static 192.168.1.96 27 192.168.1.17
[Huawei]ip route-static 192.168.1.128 27 192.168.1.17   //环回地址
[Huawei]ip route-static 192.168.1.0 30 192.168.1.17    /
[Huawei]ip route-static 192.168.1.4 30 192.168.1.17
[Huawei]ip route-static 192.168.1.8 30 192.168.1.17 
[Huawei]ip route-static 192.168.1.12 30 192.168.1.17   //骨干链路

四.写缺省和处理黑洞

AR1

[Huawei]ip route-static 0.0.0.0 0 192.168.1.2
[Huawei]ip route-static 0.0.0.0 0 192.168.1.16
ip route-static 192.168.1.32 27 NULL0

 AR2

[Huawei]ip route-static 0.0.0.0 0 192.168.1.10
[Huawei]ip route-static 192.168.1.64 27 NULL 0

AR3

[Huawei]ip route-static 0.0.0.0 0 192.168.1.14
[Huawei]ip route-static 192.168.1.96 27 NULL 0

AR4

[Huawei]ip route-static 0.0.0.0 0 192.168.1.18
[Huawei]ip route-static 192.168.1.128 27 NULL 0

五.做浮动静态

AR5


[Huawei]ip route-static 192.168.1.0 255.255.255.252 192.168.1.21 preference 68
[Huawei]ip route-static 192.168.1.4 255.255.255.252 192.168.1.21 preference 68
[Huawei]ip route-static 192.168.1.8 255.255.255.252 192.168.1.21 preference 68
[Huawei]ip route-static 192.168.1.12 255.255.255.252 192.168.1.21 preference 68
[Huawei]ip route-static 192.168.1.32 255.255.255.252 192.168.1.21 preference 68
[Huawei]ip route-static 192.168.1.64 255.255.255.252 192.168.1.21 preference 68
[Huawei]ip route-static 192.168.1.96 255.255.255.252 192.168.1.21 preference 68
[Huawei]ip route-static 192.168.1.128 255.255.255.252 192.168.1.21 preference 68

将AR5 1000M的接口shutdown,即切换到100M接口的,打开,即恢复到1000M的

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值