静态路由配置

                                                                                                                                                          

 网段划分

 将192.168.1.0/24划分为192.168.1.0/27

                                        192.168.1.32/27

                                        192.168.1.64/27

                                        192.168.1.96/27

                                        192.168.1.128/27

                                        192.168.1.160/27

将192.168.1.0/27划分为192.168.1.0/30

                                        192.168.1.4/30

                                        192.168.1.8/30

                                        192.168.1.12/30

                                        192.168.1.16/30

                                        192.168.1.20/30

                                        192.168.1.24/30

r1环回:192.168.1.33/28和192.168.1.49/28

r2环回:192.168.1.65/28和192.168.1.81/28

r4环回:192.168.1.129/28和192.168.1.145/28

r5环回:192.168.1.161/28

r6环回:1.1.1.1/24


配置ip
r1
[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 255.255.255.255 
[r1]interface g0/0/1	
[r1-GigabitEthernet0/0/1]ip address 192.168.1.9 30
[r1]interface LoopBack 2
[r1-LoopBack2]ip address 192.168.1.49 28
[r1-LoopBack2]q
[r1]dis		
[r1]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.1/30       up         up        
GigabitEthernet0/0/1              192.168.1.9/30       up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack1                         192.168.1.33/28      up         up(s)     
LoopBack2                         192.168.1.49/28      up         up(s)     
NULL0                             unassigned  
r2
[r2]interface g0/0/1
[r2-GigabitEthernet0/0/1]ip ad	
[r2-GigabitEthernet0/0/1]ip address 192.168.1.2 30
[r2]interface g0/0/0
[r2-GigabitEthernet0/0/0]ip ad	
[r2-GigabitEthernet0/0/0]ip address  192.168.1.5 30
[r2]interface LoopBack 1
[r2-LoopBack1]ip ad	
[r2-LoopBack1]ip address 192.168.1.65 28
[r2]interface LoopBack 2
[r2-LoopBack2]ip address 192.168.1.81 28
[r2-LoopBack2]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.5/30       up         up        
GigabitEthernet0/0/1              192.168.1.2/30       up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack1                         192.168.1.65/28      up         up(s)     
LoopBack2                         192.168.1.81/28      up         up(s)     
NULL0                             unassigned  
r3

[r3]interface g0/0/2
[r3-GigabitEthernet0/0/2]ip ad	
[r3-GigabitEthernet0/0/2]ip address 192.168.1.10 30
[r3]interface g0/0/1
[r3-GigabitEthernet0/0/1]ip ad	
[r3-GigabitEthernet0/0/1]ip address 192.168.1.13 30
[r3]interface g0/0/0
[r3-GigabitEthernet0/0/0]ip ad	
[r3-GigabitEthernet0/0/0]ip address 192.168.1.25 30
[r3-GigabitEthernet0/0/0]

r4
[r4]interface g0/0/0 
[r4-GigabitEthernet0/0/0]ip ad	
[r4-GigabitEthernet0/0/0]ip address 192.168.1.14 30
[r4]interface g0/0/1
[r4-GigabitEthernet0/0/1] ip ad	
[r4-GigabitEthernet0/0/1]ip address 192.168.1.6 30
[r4]interface g0/0/2
[r4-GigabitEthernet0/0/2]ip ad	
[r4-GigabitEthernet0/0/2]ip address 192.168.1.17 30
[r4]interface g4/0/0
[r4-GigabitEthernet4/0/0]ip address 192.168.1.21 30
[r4]interface LoopBack 1
[r4-LoopBack1]ip ad	
[r4-LoopBack1]ip address 192.168.1.129 28
[r4-LoopBack1]q
[r4]interface LoopBack 2
[r4-LoopBack2]ip address 192.168.1.145 28
[r4-LoopBack2]q
[r4]dis	
[r4]display  ip in	
[r4]display  ip interface  br
*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 0
The number of interface that is UP in Protocol is 7
The number of interface that is DOWN in Protocol is 0

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.14/30      up         up        
GigabitEthernet0/0/1              192.168.1.6/30       up         up        
GigabitEthernet0/0/2              192.168.1.17/30      up         up        
GigabitEthernet4/0/0              192.168.1.21/30      up         up        
LoopBack1                         192.168.1.129/28     up         up(s)     
LoopBack2                         192.168.1.145/28     up         up(s)     
NULL0                             unassigned 
r5
[r5]in g0/0/2
[r5-GigabitEthernet0/0/2]ip ad	
[r5-GigabitEthernet0/0/2]ip address 192.168.1.22 30
[r5-GigabitEthernet0/0/2]q
[r5]in g0/0/0
[r5-GigabitEthernet0/0/0]ip ad	
[r5-GigabitEthernet0/0/0]ip address 192.168.1.18 30
[r5-GigabitEthernet0/0/0]q
[r5]in g0/0/1
[r5-GigabitEthernet0/0/1]ip address 12.1.1.1 24
[r5-GigabitEthernet0/0/1]
[r5-GigabitEthernet0/0/1]q
[r5]in	
[r5]info-center
[r5]interface lo	
[r5]interface LoopBack 1
[r5-LoopBack1]ip ad	
[r5-LoopBack1]ip address 192.168.1.161 28
[r5-LoopBack1]q
r6
[r6]interface g0/0/0
[r6-GigabitEthernet0/0/0]ip ad	
[r6-GigabitEthernet0/0/0]ip address 12.1.1.2 24
[r6-GigabitEthernet0/0/0]q
[r6]in	
[r6]info-center
[r6]interface lo	
[r6]interface LoopBack 0
[r6-LoopBack0]ip ad	
[r6-LoopBack0]ip address 1.1.1.1 24

DHCP分配

r3

[r3]dhcp enable 
[r3]ip pool 1
[r3-ip-pool-1]network 192.168.1.24 mask 29
[r3-ip-pool-1]gateway-list 192.168.1.25
[r3-ip-pool-1]dns-list 8.8.8.8 1.1.1.1
[r3]interface g0/0/0
[r3-GigabitEthernet0/0/0]dhcp select globa
PC>ipconfig

Link local IPv6 address...........: fe80::5689:98ff:feee:73a6
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 0.0.0.0
Subnet mask.......................: 0.0.0.0
Gateway...........................: 192.168.1.25
Physical address..................: 54-89-98-EE-73-A6
DNS server........................: 8.8.8.8
                                    1.1.1.1

空接口路由,缺省路由,下一跳 

r1

[r1]ip route-static 192.168.1.32 255.255.255.224 null0
[r1]ip route-static 0.0.0.0 0.0.0.0 192.168.1.2
[r1]ip route-static 0.0.0.0 0.0.0.0 192.168.1.10
[r1]ip route-static 192.168.1.4 255.255.255.252 192.168.1.2
[r1]ip route-static 192.168.1.12 255.255.255.252 192.168.1.10
[r1]ip route-static 192.168.1.16 255.255.255.252 192.168.1.2
[r1]ip route-static 192.168.1.16 255.255.255.252 192.168.1.10
[r1]ip route-static 192.168.1.64 255.255.255.224 192.168.1.2
[r1]ip route-static 192.168.1.128 255.255.255.224 192.168.1.10
[r1]ip route-static 192.168.1.128 255.255.255.224 192.168.1.2
[r1]

r2

[r2]ip route-static 192.168.1.64 255.255.255.224 null0
[r2]ip route-static  0.0.0.0 0.0.0.0 192.168.1.1
[r2]ip route-static 0.0.0.0 0.0.0.0 192.168.1.6
[r2]ip route-static  192.168.1.8 255.255.255.252 191.168.1.1
[r2]ip route-static 192.168.1.12 255.255.255.252 191.168.1.6
[r2]ip route-static 192.168.1.24 255.255.255.248 191.168.1.6
[r2]ip route-static 192.168.1.16 255.255.255.248 191.168.1.6
[r2]ip route-static 192.168.1.32 255.255.255.224 191.168.1.1
[r2]ip route-static 192.168.1.128 255.255.255.224 191.168.1.6
[r2]

r3

[r3]ip route-static 0.0.0.0 0.0.0.0 192.168.1.9
[r3]ip route-static 0.0.0.0 0.0.0.0 192.168.1.14
[r3]ip route-static 192.168.1.0 255.255.255.252 192.168.1.9
[r3]ip route-static 192.168.1.4 255.255.255.252 192.168.1.14
[r3]ip route-static 192.168.1.16 255.255.255.252 192.168.1.14
[r3]ip route-static 192.168.1.32 255.255.255.252 192.168.1.9
[r3]ip route-static 192.168.1.64 255.255.255.252 192.168.1.9
[r3]ip route-static 192.168.1.64 255.255.255.252 192.168.1.14
[r3]ip route-static 192.168.1.128 255.255.255.252 192.168.1.14
[r3]

r4

[r4]ip route-static 192.168.1.128 255.255.255.224 null0
[r4]ip route-static 0.0.0.0 0.0.0.0 192.168.1.18
[r4]ip route-static 0.0.0.0 0.0.0.0 192.168.1.22 p	
[r4]ip route-static 0.0.0.0 0.0.0.0 192.168.1.22 permanent
[r4]ip route-static 0.0.0.0 0.0.0.0 192.168.1.22 preference 61
[r4]ip route-static 192.168.1.0 255.255.255.252 191.168.1.5
[r4]ip route-static 192.168.1.8 255.255.255.252 191.168.1.13
[r4]ip route-static 192.168.1.24 255.255.255.252 191.168.1.13
[r4]ip route-static 192.168.1.32 255.255.255.252 191.168.1.5
[r4]ip route-static 192.168.1.32 255.255.255.252 191.168.1.13
[r4]ip route-static 192.168.1.64 255.255.255.252 191.168.1.5
[r4]

r5

[r5]ip route-static 192.168.1.160 255.255.255.224 null0
[r5]ip route-static 0.0.0.0 0.0.0.0 12.1.1.2
[r5]ip route-static 192.168.1.0 27 192.168.1.17
[r5]ip route-static 192.168.1.0 27 192.168.1.21 pr	
[r5]ip route-static 192.168.1.0 27 192.168.1.21 preference 61
[r5]ip route-static 192.168.1.32 27 192.168.1.21 preference 61
Info: Succeeded in modifying route.
[r5]ip route-static 192.168.1.32 27 192.168.1.17
[r5]ip route-static 192.168.1.64 27 192.168.1.17
[r5]ip route-static 192.168.1.64 27 192.168.1.21 preference 61
[r5]ip route-static 192.168.1.128 27 192.168.1.17
[r5]ip route-static 192.168.1.128 27 192.168.1.21 pr	
[r5]ip route-static 192.168.1.128 27 192.168.1.21 preference 61
[r5]
NAT
[r5]acl 2000
[r5-acl-basic-2000]rule 5 permit source 192.168.1.0 0.0.0.255
[r5-acl-basic-2000]q
[r5]in	
[r5]info-center
[r5]interface g0/0/1	
[r5-GigabitEthernet0/0/1]nat outbound 2000	
[r5-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 23  inside 192.168.1.1 23 
Warning:The port 23 is well-known port. If you continue it may cause function fa
ilure.
Are you sure to continue?[Y/N]:y
实际登录到r1
<r6>telnet 12.1.1.1
  Press CTRL_] to quit telnet mode
  Trying 12.1.1.1 ...
  Connected to 12.1.1.1 ...

Login authentication


Password:
<r1>
  • 4
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

不会取名余

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值