192.168.1.0/24---划分成6个网段--2的n次方大于等于6--n就可为3借主机位三个0
汇总网段
继续分成四个网段
192.168.1.000 00000 ---192.168.1.0/27 ---路由骨干
192.168.1.000 000 00---192.168.1.0/30
192.168.1.000 00--不取
192.168.1.000 01---192.168.1.1/30
192.168.1.000 10---192.168.1.2/30
192.168.1.000 11--不取
以此类推
192.168.1.000 001 00---192.168.1.4/30---192.168.1.5-192.168.1.6
192.168.1.000 010 00---192.168.1.8/30---192.168.1.9-192.168.1.10
192.168.1.000 100 00---192.168.1.16/30---192.168.1.17-192.168.1.18
192.168.1.000 011 00---192.168.1.12/30---192.168.1.13-192.168.1.14
192.168.1.000 110 00---192.168.1.24/30---192.168.1.25-192.168.1.26
192.168.1.000 101 00
192.168.1.000 111 00
分成两个网段
192.168.1.001 00000 ---192.168.1.32/27 ---r1环回
192.168.1.001 0 0000---192.168.1.32/28
192.168.1.001 1 0000---192.168.1.48/28
192.168.1.010 00000 ---192.168.1.64/27 ---r2环回
192.168.1.010 0 0000---192.168.1.64/28
192.168.1.010 1 0000---192.168.1.80/28
192.168.1.100 00000 ---192.168.1.128/27 ---r3环回
192.168.1.100 0 0000---192.168.1.128/28
192.168.1.100 1 0000---192.168.1.144/28
192.168.1.011 00000 ---192.168.1.96/27 ---r4环回
192.168.1.011 0 0000---192.168.1.96/28
192.168.1.011 1 0000---192.168.1.112/28
192.168.1.110 00000 ---192.168.1.192/27 ---r5右边的广播域
192.168.1.110 0 0000---192.168.1.192/28
192.168.1.110 1 0000---192.168.1.208/28
192.168.1.101 00000
192.168.1.111 00000
配置路由器接口IP (直连接口+环回接口+空接口) 空接口把每一个路由器环回汇总网段变成空接口路由
展示r2的接口ip
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.1.2 30
[r2-GigabitEthernet0/0/0]q
[r2]interface GigabitEthernet 0/0/1
[r2-GigabitEthernet0/0/1]ip add 192.168.1.9 30
[r2-GigabitEthernet0/0/1]q
[r2]int l 0
[r2-LoopBack0]ip add 192.168.1.65 28
[r2-LoopBack0]q
[r2]int l 1
[r2-LoopBack1]ip add 192.168.1.81 28
[r2-LoopBack1]q
[r2]ip route-static 192.168.1.4 30 192.168.1.1
[r2]ip route-static 192.168.1.16 30 192.168.1.10
[r2]ip route-static 192.168.1.32 27 192.168.1.1
[r2]ip route-static 192.168.1.96 27 192.168.1.1
[r2]ip route-static 192.168.1.128 27 192.168.1.10
检验一下是否互通
r1 ping r5 r2 ping r4
看图显示有回复表示成功连通
DHCP(给r5配DHCP服务器让其给两个PC终端配IP地址)
Telnet(华为ensp默认开启telnet这里就没敲指令)
[r2]user-interface vty 0 4
[r2-ui-vty0-4]authentication-mode aaa
[r2-ui-vty0-4]q
[r2]aaa
[r2-aaa]local-user admin
[r2-aaa]local-user admin pa
[r2-aaa]local-user admin password ci
[r2-aaa]local-user admin password cipher admin p
[r2-aaa]local-user admin password cipher admin privilege l
[r2-aaa]local-user admin password cipher admin privilege level 15
[r2-aaa]Q
[r2-aaa]local-user admin
[r2-aaa]local-user admin servi
[r2-aaa]local-user admin service-type telnet
r1远程控制r3
路由ip静态扩展配置
以r5为例
[r5]ip route-static 192.168.1.0 30 192.168.1.13
[r5]ip route-static 192.168.1.4 30 192.168.1.13
[r5]ip route-static 192.168.1.128 27 192.168.1.13
[r5]ip route-static 192.168.1.64 27 192.168.1.13
[r5]ip route-static 192.168.1.96 27 192.168.1.13
[r5]ip route-static 192.168.1.32 27 192.168.1.13
[r5]ip route-static 192.168.1.8 30 192.168.1.13
[r5]ip route-static 192.168.1.16 30 192.168.1.25
空接口路由(把每一个环回汇总ip接口变为空接口)
[r2]ip route-static 192.168.1.64 27 nu
[r2]ip route-static 192.168.1.64 27 NULL 0
[r1]ip route-static 0.0.0.0 0 192.168.1.2
浮动静态路由
图中r5与r3有两根网线,r3路由表默认的传输的使用的网线位接口为4/0/0的接口(默认100M),当这根线出现故障时,可以修改接口IP优先级变为使用0/0/1的接口,从而达到备份的作用
r3到r5
[r3]ip route-static 0.0.0.0 0 192.168.1.26 preference 61
r5到左边全部(给每个静态IP扩展添加浮动静态)
[r5]ip route-static 192.168.1.0 30 192.168.1.25 pre 61
[r5]ip route-static 192.168.1.4 30 192.168.1.25 pre 61
[r5]ip route-static 192.168.1.128 27 192.168.1.25 pre 61
[r5]ip route-static 192.168.1.64 27 192.168.1.25 pre 61
[r5]ip route-static 192.168.1.96 27 192.168.1.25 pre 61
[r5]ip route-static 192.168.1.32 27 192.168.1.25 pre 61
当关闭默认接口,备份接口就会补上去
[r5-GigabitEthernet0/0/1]shutdown