华为路由器配置入门四(多台路由器用静态路由进行配置)
华为路由器配置入门四(多台路由器用静态路由进行配置)
思路(路由器之间的网段小经验:1和3路由器为13网段;2和3路由器为23网段;靠1路由器为192.168.13.1;靠2路由器为192.168.23.2。这样成逻辑,容易排错):
1.用ENSP搭建这样一个网络结构环境
2.由4台PC,2台交换机,3台路由器构建(相当于通过某地中转)
3.配置路由器:改路由器名字,配置console控制口密码,配置接口地址
4.交换机配置console口密码
5.配置4台PC的IP地址
6.配置3台路由器路由(网络路由联通配置)
第一、配置路由器:改路由器名字,配置console控制口密码,配置接口地址;
1.配置第一台路由器console口登录密码(这步不能忘,防止人为通过console线直接连接登录改动参数配置):
system-view 由用户模式进入系统模式
user-interface console 0 进入console口0
set authentication password cipher abc123 配置console口登录密码
sysname Router1 将路由器名词改成Router1
[Router1] interface GigabitEthernet0/0/1
[Router1-GigabitEthernet0/0/1] ip address 192.168.100.254 24 //配IP地址
[Router1]interface GigabitEthernet 0/0/0
[Router1-GigabitEthernet0/0/0]ip address 192.168.13.1 24 //配IP地址
[Router1] display ip interface brief //查询各接口IP地址配置情况
*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.13.1/24 up up
GigabitEthernet0/0/1 192.168.100.254/24 up up
GigabitEthernet0/0/2 unassigned down down
NULL0 unassigned up up(s)
2.配置第二台路由器console口登录密码:
system-view 由用户模式进入系统模式
user-interface console 0 进入console口0
set authentication password cipher abc123 配置console口登录密码
sysname Router2 将路由器名词改成Router2
[Router2] interface GigabitEthernet 0/0/0
[Router2-GigabitEthernet0/0/0] ip address 192.168.23.2 24
[Router2] interface GigabitEthernet 0/0/1
[Router2-GigabitEthernet0/0/1] ip address 192.168.200.254 24
[Router2] display ip interface brief //查询各接口IP地址配置情况
*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.23.2/24 up up
GigabitEthernet0/0/1 192.168.200.254/24 up up
GigabitEthernet0/0/2 unassigned down down
NULL0 unassigned up up(s)
3.配置第三台路由器console口登录密码:
system-view 由用户模式进入系统模式
user-interface console 0 进入console口0
set authentication password cipher abc123 配置console口登录密码
sysname Router3 将路由器名词改成Router3
[Router3] interface GigabitEthernet 0/0/0
[Router3-GigabitEthernet0/0/0] ip address 192.168.13.3 24
[Router3] interface GigabitEthernet 0/0/1
[Router3-GigabitEthernet0/0/1] ip address 192.168.23.3 24
[Router3] display ip interface brief //查询各接口IP地址配置情况
*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.13.3/24 up up
GigabitEthernet0/0/1 192.168.23.3/24 up up
GigabitEthernet0/0/2 unassigned down down
NULL0 unassigned up up(s)
第二、修改交换机名称及配置console口密码
1、第一台交换机配置
system-view //由用户模式进入系统模式
sysname SW1 //修交换机提示符名称
user-interface console 0 //进入console口0
authentication-mode password //进入密码认证模式 (这点与路由器有点不同)
set authentication password cipher abc123 //配置console口登录密码
2、第二台交换机配置
system-view //由用户模式进入系统模式
sysname SW2 //修交换机提示符名称
user-interface console 0 //进入console口0
authentication-mode password //进入密码认证模式 (这点与路由器有点不同)
set authentication password cipher abc123 //配置console口登录密码
第三、配置4台PC的IP地址(依照设计图配置,网关为路由器的本网段接口地址;)
第四、配置3台路由器(打通3台路由器之间的静态路由)
因为这些网段彼此都得通,所以各个路由器都得回答,这些网段的数据来了怎么走。可采用上面这个矩阵来协助分析,防止漏配。并配置下一跳(邻接口IP地址),并配合Ping命令进行检查确认。
1.配置第一台路由器路由表
[Router1] ip route-static 192.168.23.0 255.255.255.0 192.168.13.3
[Router1] ip route-static 192.168.200.0 255.255.255.0 192.168.13.3
2.配置第二进制台路由器路由表
[Router2] ip route-static 192.168.100.0 255.255.255.0 192.168.23.3
[Router2] ip route-static 192.168.13.0 255.255.255.0 192.168.23.3
3.配置第三进制台路由器路由表
[Router2] ip route-static 192.168.100.0 255.255.255.0 192.168.13.1
[Router2] ip route-static 192.168.200.0 255.255.255.0 192.168.23.2
4.测试工作站之间的连通性(从PC1 ping PC3)
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fe70:2b5d
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.100.1 //当前电脑
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.100.254
Physical address..................: 54-89-98-70-2B-5D
DNS server........................:
PC>ping 192.168.200.3 //另一网段电脑,连通正常
Ping 192.168.200.3: 32 data bytes, Press Ctrl_C to break
From 192.168.200.3: bytes=32 seq=1 ttl=126 time=63 ms
From 192.168.200.3: bytes=32 seq=2 ttl=126 time=78 ms
--- 192.168.200.3 ping statistics ---
3 packet(s) transmitted
2 packet(s) received
33.33% packet loss
round-trip min/avg/max = 63/70/78 ms