实验要求:
1.全网可达
2.拓扑中所需地址全部基于192.168.1.0/24划分所得
3.静态路由《不许使用其他动态)
4.R1环回需要汇总
实验思路:
1:ip地址规划,根据主干道及环回接口个数划分4个子网
2:去交换机上划分vlan、开trunk干道
3:给路由器接口配置ip、环回接口、单臂路由
4:给R1-R6写路由表,在R1-R4还要加上指向R6的缺省路由(也可以写静态路由),在R4和R5上面加上空接口防环
5:实验完毕,进行测试
实验具体过程:
IP地址规划:
R1配置IP命令如下:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip ad
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 30
Jul 17 2023 15:41:14-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.1.13 30
Jul 17 2023 15:41:50-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R1-GigabitEthernet0/0/1]q
[R1]int
[R1]interface lo
[R1]interface LoopBack 0
[R1-LoopBack0]ip ad
[R1-LoopBack0]ip address 192.168.1.65 28
[R1-LoopBack0]interface LoopBack 1
[R1-LoopBack1]ip address 192.168.1.81 28
[R1-LoopBack1]interface LoopBack 2
[R1-LoopBack2]ip address 192.168.1.97 28
[R1-LoopBack2]quit
[R1]
R2:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R2
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip ad
[R2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
Jul 17 2023 16:03:44-08:00 R2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.1.5 30
Jul 17 2023 16:04:22-08:00 R2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R2-GigabitEthernet0/0/1]q
[R2]
R3:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip ad
[R3-GigabitEthernet0/0/0]ip address 192.168.1.9 30
Jul 17 2023 16:09:02-08:00 R3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip address 192.168.1.6 30
Jul 17 2023 16:09:44-08:00 R3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R3-GigabitEthernet0/0/1]int g0/0/2
[R3-GigabitEthernet0/0/2]ip address 192.168.1.21 30
Jul 17 2023 16:11:07-08:00 R3 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
[R3-GigabitEthernet0/0/2]int g4/0/0
[R3-GigabitEthernet4/0/0]ip address 192.168.1.17 30
Jul 17 2023 16:11:51-08:00 R3 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet4/0/0 has entered the UP state.
[R3-GigabitEthernet4/0/0]q
[R3]
R4:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R4
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip ad
[R4-GigabitEthernet0/0/0]ip address 192.168.1.14 30
Jul 17 2023 16:14:37-08:00 R4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R4-GigabitEthernet0/0/0]int g0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.1.10 30
Jul 17 2023 16:15:02-08:00 R4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R4-GigabitEthernet0/0/1]q
[R4]dh
[R4]dhcp en
[R4]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[R4]ip p
[R4]ip policy-based-route
[R4]ip pool a
Info: It's successful to create an IP address pool.
[R4-ip-pool-a]g
[R4-ip-pool-a]gateway-list 192.168.1.129
[R4-ip-pool-a]ne
[R4-ip-pool-a]network 192.168.1.128 m
[R4-ip-pool-a]network 192.168.1.128 mask 255.255.255.224
[R4-ip-pool-a]dn
[R4-ip-pool-a]dns-list 8.8.8.8 114.114.114.114
[R4-ip-pool-a]q
[R4]ip pool b
Info: It's successful to create an IP address pool.
[R4-ip-pool-b]gateway-list 192.168.1.161
[R4-ip-pool-b]network 192.168.1.160 mask 255.255.255.224
[R4-ip-pool-b]dns-list 8.8.8.8 114.114.114.114
[R4-ip-pool-b]q
[R4]in
[R4]info-center
[R4]interface g
[R4]interface GigabitEthernet 0/0/2.1
[R4-GigabitEthernet0/0/2.1]do
[R4-GigabitEthernet0/0/2.1]dot1q te
[R4-GigabitEthernet0/0/2.1]dot1q termination v
[R4-GigabitEthernet0/0/2.1]dot1q termination vid 2
[R4-GigabitEthernet0/0/2.1]ip ad
[R4-GigabitEthernet0/0/2.1]ip address 192.168.1.129 27
Jul 17 2023 16:24:22-08:00 R4 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/2.1 has entered the UP state.
[R4-GigabitEthernet0/0/2.1]ar
[R4-GigabitEthernet0/0/2.1]arp b
[R4-GigabitEthernet0/0/2.1]arp broadcast en
[R4-GigabitEthernet0/0/2.1]arp broadcast enable
[R4-GigabitEthernet0/0/2.1]dh
[R4-GigabitEthernet0/0/2.1]dhcp se
[R4-GigabitEthernet0/0/2.1]dhcp select g
[R4-GigabitEthernet0/0/2.1]dhcp select global
[R4-GigabitEthernet0/0/2.1]q
[R4][R4]interface GigabitEthernet 0/0/2.2
[R4-GigabitEthernet0/0/2.2]dot1q termination vid 3
[R4-GigabitEthernet0/0/2.2]ip address 192.168.1.161 27
[R4-GigabitEthernet0/0/2.2]
Jul 17 2023 16:27:28-08:00 R4 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet0/0/2.2 has entered the UP state.
[R4-GigabitEthernet0/0/2.2]arp broadcast enable
[R4-GigabitEthernet0/0/2.2]dhcp select global
[R4-GigabitEthernet0/0/2.2]
R5
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R5
[R5]int g0/0/0
[R5-GigabitEthernet0/0/0]ip ad
[R5-GigabitEthernet0/0/0]ip address 192.168.1.22 30
Jul 17 2023 16:32:10-08:00 R5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R5-GigabitEthernet0/0/0]int g0/0/1
[R5-GigabitEthernet0/0/1]ip address 192.168.1.18 30
Jul 17 2023 16:32:39-08:00 R5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R5-GigabitEthernet0/0/1]int g0/0/2
[R5-GigabitEthernet0/0/2]ip address 100.1.1.1 24
Jul 17 2023 16:34:01-08:00 R5 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
[R5-GigabitEthernet0/0/2] q[R5]
R6:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R6
[R6]int g0/0/0
[R6-GigabitEthernet0/0/0]ip ad
[R6-GigabitEthernet0/0/0]ip address 100.1.1.2 24
Jul 17 2023 16:36:01-08:00 R6 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R6-GigabitEthernet0/0/0]
交换机3
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys LSW3
[LSW3]vlan 2
[LSW3-vlan2]q[LSW3]vlan 3
[LSW3-vlan3]q[LSW3]int
[LSW3]interface et
[LSW3]interface Eth
[LSW3]interface Ethernet0/0/1
[LSW3-Ethernet0/0/1]po
[LSW3-Ethernet0/0/1]port l
[LSW3-Ethernet0/0/1]port link-
[LSW3-Ethernet0/0/1]port link-flap
[LSW3-Ethernet0/0/1]port link-type tr
[LSW3-Ethernet0/0/1]port link-type trunk
[LSW3-Ethernet0/0/1]
Jul 17 2023 16:38:48-08:00 LSW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 5, the
change loop count is 0, and the maximum number of records is 4095.po
[LSW3-Ethernet0/0/1]port tr
[LSW3-Ethernet0/0/1]port trunk al
[LSW3-Ethernet0/0/1]port trunk allow-pass v
[LSW3-Ethernet0/0/1]port trunk allow-pass vlan 2 to 3
[LSW3-Ethernet0/0/1]
Jul 17 2023 16:39:28-08:00 LSW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 6, the
change loop count is 0, and the maximum number of records is 4095.
[LSW3-Ethernet0/0/1]interface Ethernet0/0/4
[LSW3-Ethernet0/0/4]port link-type trunk
[LSW3-Ethernet0/0/4]port trunk allow-pass vlan 2 to 3
[LSW3-Ethernet0/0/4]interface Ethernet0/0/4
Jul 17 2023 16:39:58-08:00 LSW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 8, the
change loop count is 0, and the maximum numq
[LSW3]interface Ethernet0/0/2
[LSW3-Ethernet0/0/2]port link-type access
[LSW3-Ethernet0/0/2]port default vlan 2
[LSW3-Ethernet0/0/2]
Jul 17 2023 16:48:28-08:00 LSW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 12, the
change loop count is 0, and the maximum number of records is 4095.
[LSW3-Ethernet0/0/2]interface Ethernet0/0/3
[LSW3-Ethernet0/0/3]port link-type access
[LSW3-Ethernet0/0/3]port default vlan 3
Jul 17 2023 16:49:48-08:00 LSW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 15, the
change loop count is 0, and the maximum number of records is 4095.
交换机4:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys LSW4
[LSW4]
Jul 17 2023 16:53:29-08:00 LSW4 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 4, the
change loop count is 0, and the maximum number of records is 4095.[LSW4]vl
[LSW4]vlan 2
[LSW4-vlan2]q
[LSW4]
Jul 17 2023 16:57:29-08:00 LSW4 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 8, the
change loop count is 0, and the maximum number of records is 4095.
[LSW4]vlan 3
[LSW4-vlan3]
Jul 17 2023 16:57:39-08:00 LSW4 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 9, the
change loop count is 0, and the maximum number of records is 4095.
[LSW4-vlan3]q
[LSW4]int
[LSW4]interface eth
[LSW4]interface Ethernet0/0/3
[LSW4-Ethernet0/0/3]po
[LSW4-Ethernet0/0/3]port li
[LSW4-Ethernet0/0/3]port link-ty
[LSW4-Ethernet0/0/3]port link-type tr
[LSW4-Ethernet0/0/3]port link-type trunk
[LSW4-Ethernet0/0/3]po
[LSW4-Ethernet0/0/3]port
Jul 17 2023 16:54:59-08:00 LSW4 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 5, the
change loop count is 0, and the maximum number of records is 4095.t
[LSW4-Ethernet0/0/3]port trunk a
[LSW4-Ethernet0/0/3]port trunk allow-pass v
[LSW4-Ethernet0/0/3]port trunk allow-pass vlan 2 t
[LSW4-Ethernet0/0/3]port trunk allow-pass vlan 2 to 3
[LSW4-Ethernet0/0/3]
Jul 17 2023 16:55:39-08:00 LSW4 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 6, the
change loop count is 0, and the maximum number of records is 4095.int eth0/0/1
[LSW4-Ethernet0/0/1]
[LSW4-Ethernet0/0/1]port link-type access
[LSW4-Ethernet0/0/1]port default vlan 2
Jul 17 2023 16:58:19-08:00 LSW4 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 10, the
change loop count is 0, and the maximum numbeint eth0/0/2
[LSW4-Ethernet0/0/2]port link-type access
Jul 17 2023 16:58:39-08:00 LSW4 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 11, the
change loop count is 0, and the maximum number of records is 4095.
[LSW4-Ethernet0/0/2]port default vlan 3
[LSW4-Ethernet0/0/2]
Jul 17 2023 16:58:49-08:00 LSW4 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 12, the
change loop count is 0, and the maximum number of records is 4095.[LSW4-Ethernet0/0/2]q
[LSW4]
写静态路由
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.14
[R1]ip route-static 192.168.1.4 255.255.255.252 192.168.1.2
[R1]ip route-static 192.168.1.8 255.255.255.252 192.168.1.14
[R1]ip route-static 192.168.1.16 255.255.255.252 192.168.1.14R2上的
[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 192.168.1.6
[R2]ip route-static 192.168.1.12 255.255.255.252 192.168.1.1
[R2]ip route-static 192.168.1.16 255.255.255.252 192.168.1.6
[R2]ip route-static 192.168.1.20 255.255.255.252 192.168.1.6
[R2]ip route-static 192.168.1.64 255.255.255.192 192.168.1.1
[R2]ip route-static 192.168.1.128 255.255.255.192 192.168.1.6
R3上的[R3]ip route-static 0.0.0.0 0.0.0.0 192.168.1.18
[R3]ip route-static 0.0.0.0 0.0.0.0 192.168.1.22
[R3]ip route-static 192.168.1.0 255.255.255.0 NULL 0 //空接口,防环
[R3]ip route-static 192.168.1.0 255.255.255.252 192.168.1.5
[R3]ip route-static 192.168.1.12 255.255.255.252 192.168.1.10
[R3]ip route-static 192.168.1.64 255.255.255.192 192.168.1.10
[R3]ip route-static 192.168.1.64 255.255.255.192 192.168.1.5
[R3]ip route-static 192.168.1.128 255.255.255.192 192.168.1.10R4上的
[R4]ip route-static 0.0.0.0 0.0.0.0 192.168.1.9
[R4]ip route-static 192.168.1.0 255.255.255.252 192.168.1.13
[R4]ip route-static 192.168.1.4 255.255.255.252 192.168.1.9
[R4]ip route-static 192.168.1.16 255.255.255.252 192.168.1.9
[R4]ip route-static 192.168.1.20 255.255.255.252 192.168.1.9
[R4]ip route-static 192.168.1.64 255.255.255.192 192.168.1.13R5上的
[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//修改preference值,起备份作用,又叫漂浮路由
R6上的
[R6]ip route-static 192.168.1.0 255.255.255.0 100.1.1.1
实验截图
R1
R2
R3
R4
R 5
R 6
实验结果: