HCIA静态配置实验
1.1 实验要求与拓扑图
要求:
-
全网通
-
基于192.168.1.0/24合理划分
拓扑图
1.2 实验步骤
1.2.1 划分子网
1.原IP 192.168.1.0/24 因为拓扑图共有6个广播域,所以需要划分位8个子网,使用其中6个(本次实验按照主机位从到大使用) 2. 划分 192.168.1.000 00000 192.168.1.0/27 192.168.1.001 00000 192.168.1.32/27 192.168.1.010 00000 192.168.1.64/27 192.168.1.011 00000 192.168.1.96/27 192.168.1.100 00000 192.168.1.128/27 192.168.1.101 00000 192.168.1.160/27 192.168.1.110 00000 192.168.1.192/27 192.168.1.111 00000 192.168.1.224/27 3.划分后子网掩码 255.255.255.224(划分前子网掩码:255.255.255.0)
1.2.2 配置设备
PC5:
AR7:
<Huawei>system-view # 进入系统视图 Enter system view, return user view with Ctrl+Z. [Huawei]sysname AR7 # 更改设备名称 # 进入路由器AR7的 g 0/0/0接口配置IP [AR7]interface g 0/0/0 [AR7-GigabitEthernet0/0/0]ip address 192.168.1.2 27 Jan 24 2024 22:31:46-08:00 AR7 %%01IFNET/4/LINK_STATE(l)[4]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. [AR7-GigabitEthernet0/0/0]q [AR7] # 进入路由器AR7的 g 0/0/1接口配置IP [AR7]interface g 0/0/1 [AR7-GigabitEthernet0/0/1]ip address 192.168.1.33 27 Jan 24 2024 22:28:19-08:00 AR7 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state. [AR7-GigabitEthernet0/0/1]q [AR7] # 进入路由器AR7的 g 0/0/2接口配置IP [AR7]interface g 0/0/2 [AR7-GigabitEthernet0/0/2]ip address 192.168.1.97 27 Jan 24 2024 22:28:46-08:00 AR7 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP on the interface GigabitEthernet0/0/2 has entered the UP state. [AR7-GigabitEthernet0/0/2]q [AR7] # 查看是否配置成功 [AR7]display interface brief PHY: Physical *down: administratively down (l): loopback (s): spoofing (b): BFD down ^down: standby (e): ETHOAM down (d): Dampening Suppressed InUti/OutUti: input utility/output utility Interface PHY Protocol InUti OutUti inErrors outErrors GigabitEthernet0/0/0 up up 0% 0% 0 0 #3个接口均被使用,均双UP,成功 GigabitEthernet0/0/1 up up 0% 0% 0 0 GigabitEthernet0/0/2 up up 0% 0% 0 0 NULL0 up up(s) 0% 0% 0 0 [AR7] [AR7]display ip interface brief *down: administratively down ^down: standby (l): loopback (s): spoofing The number of interface that is UP in Physical is 4 The number of interface that is DOWN in Physical is 0 The number of interface that is UP in Protocol is 4 The number of interface that is DOWN in Protocol is 0 Interface IP Address/Mask Physical Protocol GigabitEthernet0/0/0 192.168.1.2/27 up up GigabitEthernet0/0/1 192.168.1.33/27 up up GigabitEthernet0/0/2 192.168.1.97/27 up up NULL0 unassigned up up(s) [AR7]
AR9:
<Huawei>system-view Enter system view, return user view with Ctrl+Z. [Huawei]sysname AR9 [AR9]interface g 0/0/0 [AR9-GigabitEthernet0/0/0]ip address 192.168.1.34 27 Jan 24 2024 22:33:43-08:00 AR9 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. [AR9-GigabitEthernet0/0/0]q [AR9] [AR9]interface g 0/0/1 [AR9-GigabitEthernet0/0/1]ip address 192.168.1.65 27 Jan 24 2024 22:34:12-08:00 AR9 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state. [AR9-GigabitEthernet0/0/1] [AR9-GigabitEthernet0/0/1]q [AR9] [AR9]display interface brief PHY: Physical *down: administratively down (l): loopback (s): spoofing (b): BFD down ^down: standby (e): ETHOAM down (d): Dampening Suppressed InUti/OutUti: input utility/output utility Interface PHY Protocol InUti OutUti inErrors outErrors GigabitEthernet0/0/0 up up 0% 0% 0 0 GigabitEthernet0/0/1 up up 0% 0% 0 0 GigabitEthernet0/0/2 down down 0% 0% 0 0 NULL0 up up(s) 0% 0% 0 0 [AR9] [AR9]display ip interface brief *down: administratively down ^down: standby (l): loopback (s): spoofing The number of interface that is UP in Physical is 3 The number of interface that is DOWN in Physical is 1 The number of interface that is UP in Protocol is 3 The number of interface that is DOWN in Protocol is 1 Interface IP Address/Mask Physical Protocol GigabitEthernet0/0/0 192.168.1.34/27 up up GigabitEthernet0/0/1 192.168.1.65/27 up up GigabitEthernet0/0/2 unassigned down down NULL0 unassigned up up(s) [AR9]
AR10:
<Huawei>system-view Enter system view, return user view with Ctrl+Z. [Huawei]sysname AR10 [AR10]interface g 0/0/0 [AR10-GigabitEthernet0/0/0]ip address 192.168.1.129 27 Jan 24 2024 22:36:02-08:00 AR10 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol I P on the interface GigabitEthernet0/0/0 has entered the UP state. [AR10-GigabitEthernet0/0/0]q [AR10] [AR10]interface g 0/0/1 [AR10-GigabitEthernet0/0/1]ip address 192.168.1.98 27 Jan 24 2024 22:37:06-08:00 AR10 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol I P on the interface GigabitEthernet0/0/1 has entered the UP state. [AR10-GigabitEthernet0/0/1]q [AR10] [AR10]display interface brief PHY: Physical *down: administratively down (l): loopback (s): spoofing (b): BFD down ^down: standby (e): ETHOAM down (d): Dampening Suppressed InUti/OutUti: input utility/output utility Interface PHY Protocol InUti OutUti inErrors outErrors GigabitEthernet0/0/0 up up 0% 0% 0 0 GigabitEthernet0/0/1 up up 0% 0% 0 0 GigabitEthernet0/0/2 down down 0% 0% 0 0 NULL0 up up(s) 0% 0% 0 0 [AR10] [AR10]display ip interface brief *down: administratively down ^down: standby (l): loopback (s): spoofing The number of interface that is UP in Physical is 3 The number of interface that is DOWN in Physical is 1 The number of interface that is UP in Protocol is 3 The number of interface that is DOWN in Protocol is 1 Interface IP Address/Mask Physical Protocol GigabitEthernet0/0/0 192.168.1.129/27 up up GigabitEthernet0/0/1 192.168.1.98/27 up up GigabitEthernet0/0/2 unassigned down down NULL0 unassigned up up(s) [AR10]
AR8:
<Huawei>system-view Enter system view, return user view with Ctrl+Z. [Huawei]sysname AR8 [AR8] [AR8]interface g 0/0/0 [AR8-GigabitEthernet0/0/0]ip address 192.168.1.66 27 Jan 24 2024 22:39:18-08:00 AR11 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol I P on the interface GigabitEthernet0/0/0 has entered the UP state. [AR8-GigabitEthernet0/0/0]q [AR8] [AR8]interface g 0/0/1 [AR8-GigabitEthernet0/0/1]ip address 192.168.1.162 27 Jan 24 2024 22:41:25-08:00 AR8 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state. [AR8-GigabitEthernet0/0/1]q [AR8] [AR8]interface g 0/0/2 [AR8-GigabitEthernet0/0/2]ip address 192.168.1.130 27 Jan 24 2024 22:42:06-08:00 AR8 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP on the interface GigabitEthernet0/0/2 has entered the UP state. [AR8-GigabitEthernet0/0/2]q [AR8] [AR8]display interface brief PHY: Physical *down: administratively down (l): loopback (s): spoofing (b): BFD down ^down: standby (e): ETHOAM down (d): Dampening Suppressed InUti/OutUti: input utility/output utility Interface PHY Protocol InUti OutUti inErrors outErrors GigabitEthernet0/0/0 up up 0% 0% 0 0 GigabitEthernet0/0/1 up up 0% 0% 0 0 GigabitEthernet0/0/2 up up 0% 0% 0 0 NULL0 up up(s) 0% 0% 0 0 [AR8] [AR8]display ip interface brief *down: administratively down ^down: standby (l): loopback (s): spoofing The number of interface that is UP in Physical is 4 The number of interface that is DOWN in Physical is 0 The number of interface that is UP in Protocol is 4 The number of interface that is DOWN in Protocol is 0 Interface IP Address/Mask Physical Protocol GigabitEthernet0/0/0 192.168.1.66/27 up up GigabitEthernet0/0/1 192.168.1.162/27 up up GigabitEthernet0/0/2 192.168.1.130/27 up up NULL0 unassigned up up(s) [AR8]
PC6:
1.2.3 静态配置路由表
全网通: 每一台路由器都拥有全网所有的路由条目(网段信息),即可达到全网通
AR7:
配置前的路由表:
配置命令:
ip route-static 192.168.1.64 27 192.168.1.34 # .1.64网段在上方 ip route-static 192.168.1.128 27 192.168.1.98 # .1.128网段在下方 ip route-static 192.168.1.160 27 192.168.1.34 # .1.160从上下两条路 ip route-static 192.168.1.160 27 192.168.1.98
配置后的路由表:
AR8:
配置前路由表:
配置命令:
ip route-static 192.168.1.0 27 192.168.1.129 # .1.0网段有上下两条路 ip route-static 192.168.1.0 27 192.168.1.65 ip route-static 192.168.1.32 27 192.168.1.65 # .1.32网段在上方 ip route-static 192.168.1.96 27 192.168.1.129 # .1.96网段在下方
配置后的路由表:
AR9:
配置前的路由表:
配置命令:
ip route-static 192.168.1.0 27 192.168.1.33 # .1.0网段在左边 ip route-static 192.168.1.96 27 192.168.1.33 # .1.96网段在左边 ip route-static 192.168.1.128 27 192.168.1.66 # .1.128网段在右边 ip route-static 192.168.1.160 27 192.168.1.66 # .1.160网段在右边
配置后的路由表:
AR10:
配置前的路由表:
配置命令:
ip route-static 192.168.1.0 27 192.168.1.97 # .1.0网段在左边 ip route-static 192.168.1.32 27 192.168.1.97 # .1.32网段在左边 ip route-static 192.168.1.64 27 192.168.1.130 # .1.64网段在右边 ip route-static 192.168.1.160 27 192.168.1.130 # .1.160网段在右边
配置后的路由表:
1.3 验证
1.3.1 PC5pingPC6
1.3.2 AR7pingAR8的0/0/0接口
1.3.3 AR7pingAR8的0/0/2接口
1.3.4 综上,全网通已完成
1.4 注意点
1.4.1 下一跳的选择
首先分清方向,然后确保选作下一跳的接口能找到需要的网段,否者无法实现全网通。