静态路由实验

这篇博客详细记录了网络配置的过程,包括拓扑设计中IP地址的划分,环回IP及接口IP的配置,R1的路由汇总,VLAN的创建与配置,路由器子接口的设定,静态路由的配置,以及缺省路由的设定。此外,还涉及到端口地址转换和浮动静态路由的设置,为网络连通性和流量管理提供了全面的实践指导。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

目录

题目

拓扑设计以及IP地址的划分

配置环回IP

配置IP 地址

给R1做路由汇总

创建VLAN并配置

配置路由器子接口

配置静态路由

配置缺省路由

端口地址转换

浮动静态

测试


 

题目

拓扑设计以及IP地址的划分

 

配置环回IP

R1

[r1]int lo0
[r1-LoopBack0]ip add 192.168.0.1 30
[r1-LoopBack0]int lo1              
[r1-LoopBack1]ip add 192.168.0.5 30
[r1-LoopBack1]int lo2              
[r1-LoopBack2]ip add 192.168.0.9 30

配置IP 地址

R1

[r1-GigabitEthernet0/0/0]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 192.168.0.49 28     
[r1-GigabitEthernet0/0/1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.169.0.17 28

R2

[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.0.18 28
Jul 17 2022 18:02:11-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 g0/0/1            
[Huawei-GigabitEthernet0/0/1]ip add 192.168.0.33 28
Jul 17 2022 18:02:27-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]

R3

[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.0.50 28
[r3-GigabitEthernet0/0/0]int g0/0/1            
[r3-GigabitEthernet0/0/1]ip add 192.168.0.65 28

R4

[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.0.66 28
[r4-GigabitEthernet0/0/0]int g0/0/1            
[r4-GigabitEthernet0/0/1]ip add 192.168.0.34 28
[r4-GigabitEthernet0/0/1]int g0/0/2            
[r4-GigabitEthernet0/0/2]ip add 192.168.0.113 28
[r4-GigabitEthernet0/0/2]int g4/0/0  
[r4-GigabitEthernet4/0/0]ip add 192.168.0.97 28 

R5

[r5]int g0/0/0
[r5-GigabitEthernet0/0/0]ip add 192.168.0.114 28
[r5-GigabitEthernet0/0/0]int g0/0/1
[r5-GigabitEthernet0/0/1]ip add 192.168.0.98 28 
[r5]int g0/0/2
[r5-GigabitEthernet0/0/2]ip add 100.1.1.2 24

R6

[R6]int g0/0/0
[R6-GigabitEthernet0/0/0]ip add 100.1.1.1 24

 

给R1做路由汇总

[r1]int g0/0/0                
[r1-GigabitEthernet0/0/0]rip summary-address 192.168.0.0 255.255.255.240
[r1-GigabitEthernet0/0/0]int g0/0/1                                     
[r1-GigabitEthernet0/0/1]rip summary-address 192.168.0.0 255.255.255.240

 做完汇总要做一个空接口

[r1]ip route-static 192.168.0.0 28 NULL 0

创建VLAN并配置

SW1

[sw1]vlan 2
[sw1-vlan2]q
[sw1]vlan 3
[sw1-vlan3]q
[sw1]int e0/0/2
[sw1-Ethernet0/0/2]port link-type access 
[sw1-Ethernet0/0/2]port default vlan 2
[sw1-Ethernet0/0/2]int e0/0/3           
[sw1-Ethernet0/0/3]port link-type access
[sw1-Ethernet0/0/3]port default vlan 3

设置trunk干道

[sw1-Ethernet0/0/3]int e0/0/4           
[sw1-Ethernet0/0/4]port link-type trunk 
[sw1-Ethernet0/0/4]port trunk allow-pass vlan 2 to 3
[sw1-Ethernet0/0/4]int e0/0/1                       
[sw1-Ethernet0/0/1]port link-type trunk 
[sw1-Ethernet0/0/1]port trunk allow-pass vlan 2 to 3

 

SW2

[sw2]vlan 2
[sw2-vlan2]vlan 2
[sw2-vlan2]q
[sw2]vlan 3
[sw2-vlan3]
[sw2]int e0/0/2
[sw2-Ethernet0/0/2]p l a
[sw2-Ethernet0/0/2]p d v 2
[sw2-Ethernet0/0/2]int e0/0/3
[sw2-Ethernet0/0/3]p l a     
[sw2-Ethernet0/0/3]p d v 3   

设置trunk干道

[sw2]int e0/0/1          
[sw2-Ethernet0/0/1]port link-type trunk
[sw2-Ethernet0/0/1]port trunk allow-pass vlan 2 to 3

配置路由器子接口

R3

[r3]int g0/0/2.1
[r3-GigabitEthernet0/0/2.1]ip add 192.168.0.81 28
[r3-GigabitEthernet0/0/2.1]dot1q termination vid 3 
[r3-GigabitEthernet0/0/2.1]arp broadcast enable   
[r3-GigabitEthernet0/0/2.1]int g0/0/2.2          
[r3-GigabitEthernet0/0/2.2]ip add 192.168.0.129 28
[r3-GigabitEthernet0/0/2.2]dot1q termination vid 2
[r3-GigabitEthernet0/0/2.2]arp broadcast enable 

 

配置静态路由

AR1

[r1]ip route-static 192.168.0.32 28 192.168.0.18
[r1]ip route-static 192.168.0.64 28 192.168.0.50
[r1]ip route-static 192.168.0.96 28 192.168.0.50
[r1]ip route-static 192.168.0.96 28 192.168.0.18
[r1]ip route-static 192.168.0.112 28 192.168.0.18
[r1]ip route-static 192.168.0.112 28 192.168.0.50
[r1]ip route-static 192.168.0.80 28 192.168.0.50 
[r1]ip route-static 192.168.0.128 28 19.168.0.50

AR2

[r2]ip route-static 192.168.0.0 28 192.168.0.17
[r2]ip route-static 192.168.0.48 28 192.168.0.17
[r2]ip route-static 192.168.0.64 28 192.168.0.34
[r2]ip route-static 192.168.0.96 28 192.168.0.34
[r2]ip route-static 192.168.0.112 28 192.168.0.34
[r2]ip route-static 192.168.0.80 28 192.168.0.17 
[r2]ip route-static 192.168.0.80 28 192.168.0.34
[r2]ip route-static 192.168.0.128 28 192.168.0.17
[r2]ip route-static 192.168.0.128 28 192.168.0.34

AR3

[r3]ip route-static 192.168.0.0 28 192.168.0.49
[r3]ip route-static 192.168.0.16 28 192.168.0.49
[r3]ip route-static 192.168.0.32 28 192.168.0.66
[r3]ip route-static 192.168.0.96 28 192.168.0.66
[r3]ip route-static 192.168.0.112 28 192.168.0.66

AR4

[r4]ip route-static 192.168.0.0 28 192.168.0.33
[r4]ip route-static 192.168.0.0 28 192.168.0.65
[r4]ip route-static 192.168.0.16 28 192.168.0.33
[r4]ip route-static 192.168.0.48 28 192.168.0.65
[r4]ip route-static 192.168.0.128 28 192.168.0.65
[r4]ip route-static 192.168.0.80 28 192.168.0.65

AR5

[r5]ip route-static 192.168.0.0 28 192.168.0.97
[r5]ip route-static 192.168.0.0 28 192.168.0.113
[r5]ip route-static 192.168.0.16 28 192.168.0.97
[r5]ip route-static 192.168.0.16 28 192.168.0.113
[r5]ip route-static 192.168.0.48 28 192.168.0.97
[r5]ip route-static 192.168.0.48 28 192.168.0.113
[r5]ip route-static 192.168.0.32 28 192.168.0.97
[r5]ip route-static 192.168.0.32 28 192.168.0.113
[r5]ip route-static 192.168.0.64 28 192.168.0.97
[r5]ip route-static 192.168.0.64 28 192.168.0.113
[r5]ip route-static 192.168.0.80 28 192.168.0.97
[r5]ip route-static 192.168.0.80 28 192.168.0.113
[r5]ip route-static 192.168.0.128 28 192.168.0.97
[r5]ip route-static 192.168.0.128 28 192.168.0.113

配置缺省路由

[r1]ip route-static 0.0.0.0 0.0.0.0 192.168.0.18
[r1]ip route-static 0.0.0.0 0.0.0.0 192.168.0.50
[r2]ip route-static 0.0.0.0 0.0.0.0 192.168.0.34
[r3]ip route-static 0.0.0.0 0.0.0.0 192.168.0.66
[r4]ip route-static 0.0.0.0 0.0.0.0 192.168.0.98
[r4]ip route-static 0.0.0.0 0.0.0.0 192.168.0.114

端口地址转换

[r5]acl 2000
[r5-acl-basic-2000]rule permit source any                    
[r5-acl-basic-2000]int g0/0/2
[r5-GigabitEthernet0/0/2]nat outbound 2000

浮动静态

ip route-static 100.1.1.0 24 192.168.0.98 preference 61

测试

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值