eNSP-静态路由扩展配置
一、题目要求
1.R1-R5 为局域网 , 私有地址 192.168.1.0/24 ,请合理分配 ;
2.R1,R2,R4,各有两个环回地址,R5,R6各有一个环回地址 ; 所有由器上环回均代表连接用户的接囗 ;
3.R3 下的两台 pc通过 DHCP 自动获取IP地址 ;
4.选路最佳,路由表尽量小,避免环路;
5.R4和R5正常通过1000M链路,故障时通过100M链路;
二、题目分析
1.IP地址规划
由图可以计算出需要14个网段
要将192.168.1.0/24划分为14个网段,可以按照如下步骤进行划分:
- 确定每个子网所需的主机数量。由于需要划分为14个子网,但是经过汇总可以发现需要六个子网即可。可以使用2的幂次方找到最接近于6的数,即8,需要三位二进制位,因此我们选择使用/27(24+3=27)的子网掩码划分出8个网段(其中两个保留)。
- 进行子网划分。根据所选择的子网掩码,可以得到如下图子网划分:
2.环回接口代码
[r1]interface LoopBack 0
[r1-LoopBack0]ip add
[r1-LoopBack0]ip address 192.168.1.x x
3.路由表分配
- R1:
R1缺省路由->R2
R1缺省路由->R3
R1->R2,R3业务网段
R1->R4两条骨干网段
- R2:
R2缺省路由->R4
R2->R1,R4业务网段
R2->R3两条骨干网段
- R3:
R3缺省路由->R4
R3->R1,R4业务网段
R3->R2两条骨干网段
- R4:
R4->R1两条等价路由
R4->R5两条浮动路由
R4->R2,R3业务网段
R4->R1两条骨干网段
- R5:
192.168.1.0/24->R4两条浮动路由
- 除此之外配置空借口路由避免产生路由环路。
三、拓扑结构搭建
四、基本配置
根据上方分析输入命令
配置接口地址
#配置接口地址
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.1 30
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 192.168.1.5 30
[R1-GigabitEthernet0/0/1]int l 0
[R1-LoopBack0]ip add 192.168.1.33 28
[R1-LoopBack0]int l 1
[R1-LoopBack1]ip add 192.168.1.49 28
R2,R4,R5根据分析配置相应ip。
R1:
#路由表
[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.6
[R1]ip route-static 192.168.1.8 255.255.255.252 192.168.1.2
[R1]ip route-static 192.168.1.12 255.255.255.252 192.168.1.6
[R1]ip route-static 192.168.1.64 255.255.255.224 192.168.1.2
[R1]ip route-static 192.168.1.96 255.255.255.224 192.168.1.6
#汇总,避免产生路由黑洞
[R1]ip route-static 192.168.1.32 27 NULL 0
R2:
#路由表
[R2]ip route-static 0.0.0.0 0.0.0.0 192.168.1.10
[R2]ip route-static 192.168.1.4 255.255.255.252 192.168.1.1
[R2]ip route-static 192.168.1.32 255.255.255.224 192.168.1.1
[R2]ip route-static 192.168.1.96 255.255.255.224 192.168.1.1
[R2]ip route-static 192.168.1.96 255.255.255.224 192.168.1.10
#汇总,避免产生路由黑洞
[R2]ip route-static 192.168.1.64 27 NULL 0
R3:
#路由表
[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.5
[R3]ip route-static 192.168.1.32 255.255.255.224 192.168.1.5
[R3]ip route-static 192.168.1.64 255.255.255.224 192.168.1.5
[R3]ip route-static 192.168.1.64 255.255.255.224 192.168.1.14
#汇总,避免产生路由黑洞
[R3]ip route-static 192.168.1.96 27 NULL 0
#开启DHCP服务
[R3]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[R3]ip pool pool
Info: It's successful to create an IP address pool.
[R3-ip-pool-pool]network 192.168.1.96 mask 27
[R3-ip-pool-pool]gateway-list 192.168.1.97
[R3-ip-pool-pool]dns-list 8.8.8.8
[R3-ip-pool-pool]int g0/0/2
[R3-GigabitEthernet0/0/2]dhcp select global
R4:
#路由表
[R4]ip route-static 192.168.1.0 255.255.255.252 192.168.1.9
[R4]ip route-static 192.168.1.4 255.255.255.252 192.168.1.13
[R4]ip route-static 192.168.1.32 255.255.255.224 192.168.1.9
[R4]ip route-static 192.168.1.32 255.255.255.224 192.168.1.13
[R4]ip route-static 192.168.1.64 255.255.255.224 192.168.1.9
[R4]ip route-static 192.168.1.96 255.255.255.224 192.168.1.13
[R4]ip route-static 192.168.1.160 255.255.255.224 192.168.1.18
[R4]ip route-static 192.168.1.160 255.255.255.224 192.168.1.22 preference 70
#汇总,避免产生路由黑洞
[R4]ip route-static 192.168.1.128 27 NULL 0
R5:
#路由表
[R5]ip route-static 192.168.1.0 255.255.255.0 192.168.1.17
[R5]ip route-static 192.168.1.0 255.255.255.0 192.168.1.21 preference 70
#汇总,避免产生路由黑洞
[R5]ip route-static 192.168.1.0 24 NULL 0
五、测试验证
1.DHCP验证
PC1:
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fe5e:460b
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 0.0.0.0
Subnet mask.......................: 0.0.0.0
Gateway...........................: 0.0.0.0
Physical address..................: 54-89-98-5E-46-0B
DNS server........................:
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fe5e:460b
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.1.126
Subnet mask.......................: 255.255.255.224
Gateway...........................: 192.168.1.97
Physical address..................: 54-89-98-5E-46-0B
DNS server........................: 8.8.8.8
PC2:
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fea3:c90
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 0.0.0.0
Subnet mask.......................: 0.0.0.0
Gateway...........................: 0.0.0.0
Physical address..................: 54-89-98-A3-0C-90
DNS server........................:
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fea3:c90
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.1.125
Subnet mask.......................: 255.255.255.224
Gateway...........................: 192.168.1.97
Physical address..................: 54-89-98-A3-0C-90
DNS server........................: 8.8.8.8
2.全网可达验证文章来源:https://www.toymoban.com/news/detail-516130.html
PC1ping各个路由器环回文章来源地址https://www.toymoban.com/news/detail-516130.html
PC>ping 192.168.1.33
Ping 192.168.1.33: 32 data bytes, Press Ctrl_C to break
From 192.168.1.33: bytes=32 seq=1 ttl=254 time=47 ms
From 192.168.1.33: bytes=32 seq=2 ttl=254 time=32 ms
From 192.168.1.33: bytes=32 seq=3 ttl=254 time=31 ms
From 192.168.1.33: bytes=32 seq=4 ttl=254 time=47 ms
From 192.168.1.33: bytes=32 seq=5 ttl=254 time=31 ms
--- 192.168.1.33 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 31/37/47 ms
PC>ping 192.168.1.65
Ping 192.168.1.65: 32 data bytes, Press Ctrl_C to break
From 192.168.1.65: bytes=32 seq=1 ttl=253 time=16 ms
From 192.168.1.65: bytes=32 seq=2 ttl=253 time=47 ms
From 192.168.1.65: bytes=32 seq=3 ttl=253 time=62 ms
From 192.168.1.65: bytes=32 seq=4 ttl=253 time=63 ms
From 192.168.1.65: bytes=32 seq=5 ttl=253 time=46 ms
--- 192.168.1.65 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 16/46/63 ms
PC>ping 192.168.1.129
Ping 192.168.1.129: 32 data bytes, Press Ctrl_C to break
From 192.168.1.129: bytes=32 seq=1 ttl=254 time=31 ms
From 192.168.1.129: bytes=32 seq=2 ttl=254 time=32 ms
From 192.168.1.129: bytes=32 seq=3 ttl=254 time=31 ms
From 192.168.1.129: bytes=32 seq=4 ttl=254 time=31 ms
From 192.168.1.129: bytes=32 seq=5 ttl=254 time=31 ms
--- 192.168.1.129 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 31/31/32 ms
PC>ping 192.168.1.161
Ping 192.168.1.161: 32 data bytes, Press Ctrl_C to break
From 192.168.1.161: bytes=32 seq=1 ttl=253 time=47 ms
From 192.168.1.161: bytes=32 seq=2 ttl=253 time=31 ms
From 192.168.1.161: bytes=32 seq=3 ttl=253 time=32 ms
From 192.168.1.161: bytes=32 seq=4 ttl=253 time=47 ms
From 192.168.1.161: bytes=32 seq=5 ttl=253 time=31 ms
--- 192.168.1.161 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 31/37/47 ms
到了这里,关于eNSP-静态路由扩展配置的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!