华为路由器配置入门五:多台路由器构建环形路由结构
华为路由器配置入门五:环形结构
思路(路由器之间的网段小经验:1和2路由器为12网段;3和4路由器为34网段;靠1路由器为192.168.41.1;靠2路由器为192.168.23.2。这样成逻辑,容易排错):
1.用ENSP搭建这样一个网络结构环境:由8台PC,4台交换机,4台路由器构建环形结构
2.基础配置:改路由器、交换机名字,配置console控制口密码,配置接口地址;
3.配置8台PC的IP地址
4.配置4台路由器路由(网络路由联通配置)
1.用ENSP搭建这样一个网络结构环境:由8台PC,4台交换机,4台路由器构建环形结构
2.基础配置:改路由器、交换机名字,配置console控制口密码,配置接口地址;
2.1.配置第一台路由器console口登录密码:
system-view //由用户模式进入系统模式
user-interface console 0 //进入console口0
set authentication password cipher abc123 //配置console口登录密码
sysname Router1 //将路由器名词改成Router1
[Router1] interface GigabitEthernet0/0/0
[Router1-GigabitEthernet0/0/0] ip address 192.168.12.1 24 //配IP地址
[Router1]interface GigabitEthernet 0/0/1
[Router1-GigabitEthernet0/0/1]ip address 192.168.41.1 24 //配IP地址
[Router1]interface GigabitEthernet 0/0/2
[Router1-GigabitEthernet0/0/2]ip address 192.168.1.254 24 //配IP地址
2.2.配置第二台路由器console口登录密码:
system-view //由用户模式进入系统模式
user-interface console 0 //进入console口0
set authentication password cipher abc123 //配置console口登录密码
sysname Router2 //将路由器名词改成Router2
[Router2] interface GigabitEthernet0/0/0
[Router2-GigabitEthernet0/0/0] ip address 192.168.12.2 24 //配IP地址
[Router2]interface GigabitEthernet 0/0/1
[Router2-GigabitEthernet0/0/1]ip address 192.168.23.2 24 //配IP地址
[Router2]interface GigabitEthernet 0/0/2
[Router2-GigabitEthernet0/0/2]ip address 192.168.2.254 24 //配IP地址
2.3.配置第三台路由器console口登录密码:
system-view //由用户模式进入系统模式
user-interface console 0 //进入console口0
set authentication password cipher abc123 //配置console口登录密码
sysname Router3 //将路由器名词改成Router3
[Router3] interface GigabitEthernet0/0/0
[Router3-GigabitEthernet0/0/0] ip address 192.168.34.3 24 //配IP地址
[Router3]interface GigabitEthernet 0/0/1
[Router3-GigabitEthernet0/0/1]ip address 192.168.23.3 24 //配IP地址
[Router3]interface GigabitEthernet 0/0/2
[Router3-GigabitEthernet0/0/2]ip address 192.168.3.254 24 //配IP地址
2.4.配置第四台路由器console口登录密码:
system-view //由用户模式进入系统模式
user-interface console 0 //进入console口0
set authentication password cipher abc123 //配置console口登录密码
sysname Router4 //将路由器名词改成Router4
[Router4] interface GigabitEthernet0/0/0
[Router4-GigabitEthernet0/0/0] ip address 192.168.34.4 24 //配IP地址
[Router4]interface GigabitEthernet 0/0/1
[Router4-GigabitEthernet0/0/1]ip address 192.168.41.4 24 //配IP地址
[Router4]interface GigabitEthernet 0/0/2
[Router4-GigabitEthernet0/0/2]ip address 192.168.4.254 24 //配IP地址
3.配置8台PC的IP地址(其他配置类似)
4.配置4台路由器路由(网络路由联通配置)
根据上面矩阵路由配置分析,逐台路由器进行路由配置
Router1 配置
[Router1]ip route-static 192.168.23.0 24 192.168.12.2
[Router1]ip route-static 192.168.2.0 24 192.168.12.2
[Router1]ip route-static 192.168.3.0 24 192.168.12.2
[Router1]ip route-static 192.168.4.0 24 192.168.41.4
[Router1]ip route-static 192.168.34.0 24 192.168.41.4
Router2 配置
[Router2]ip route-static 192.168.1.0 24 192.168.12.1
[Router2]ip route-static 192.168.3.0 24 192.168.23.3
[Router2]ip route-static 192.168.4.0 24 192.168.12.1
[Router2]ip route-static 192.168.34.0 24 192.168.23.3
[Router2]ip route-static 192.168.41.0 24 192.168.12.1
Router3配置
[Router3]ip route-static 192.168.1.0 24 192.168.34.4
[Router3]ip route-static 192.168.2.0 24 192.168.23.2
[Router3]ip route-static 192.168.4.0 24 192.168.34.4
[Router3]ip route-static 192.168.12.0 24 192.168.23.2
[Router3]ip route-static 192.168.41.0 24 192.168.34.4
Router4 配置
[Router4]ip route-static 192.168.1.0 24 192.168.41.1
[Router4]ip route-static 192.168.2.0 24 192.168.41.1
[Router4]ip route-static 192.168.3.0 24 192.168.34.3
[Router4]ip route-static 192.168.12.0 24 192.168.41.1
[Router4]ip route-static 192.168.23.0 24 192.168.34.3
PC8 与PC3的Ping通测试(其他类似测试)
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fe96:6779
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.4.8
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.4.254
Physical address..................: 54-89-98-96-67-79
DNS server........................:
PC>ping 192.168.2.3
Ping 192.168.2.3: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.2.3: bytes=32 seq=2 ttl=125 time=78 ms
From 192.168.2.3: bytes=32 seq=3 ttl=125 time=78 ms
From 192.168.2.3: bytes=32 seq=4 ttl=125 time=78 ms
From 192.168.2.3: bytes=32 seq=5 ttl=125 time=78 ms
--- 192.168.2.3 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/78/78 ms