目录
命名更改
子网划分
配置IP
DHCP配置
配置静态路由
NET设置
Telnet及端口映射
命名更改
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1
[R1]
1、R6为ISP,接口IP地址均为公有地址(12.0.0.0/24),该设备只能配置IP地址,之后不能再对其进行任何配置;
2、R1-R5为局域网,私有IP地址192.168.1.0/24,请合理分配;
3、R1、R2、R4,各有两个环回IP地址;R5,R6(1.1.1.0/24)各有一个环回地址;所有路由器上环回均代表连接用户的接口;
子网划分
考虑到路由表尽量小,后续将会使用子网汇总,所以将同一个路由器的两个环回接口划分到一个网段,后续再分。因为骨干链路只需要两个IP,所以主机位有两位即可,骨干链路的网段需要30个网络位,2个主机位。将骨干链路都放在一个网段,同一个路由器的环回都放在一个网段,即一共需要6个网段(网络位为27位)。且骨干链路有6条,需要3个主机位换为网络位,即刚好满足上述骨干链路30个网络位2个主机位的条件。
骨干链路 --- 192.168.1.0000 0000
R1-R2 --- 192.168.1.0000 0000 --- 192.168.1.0/30
R2-R4 --- 192.168.1.0000 0100 --- 192.168.1.4/30
R1-R3 --- 192.168.1.0000 1000 --- 192.168.1.8/30
R3-R4 --- 192.168.1.0000 1100 --- 192.168.1.12/30
R4-R5(1000M) --- 192.168.1.0001 0000 --- 192.168.1.16/30
R4-R5(100M) --- 192.168.1.0001 0100 --- 192.168.1.20/30
R1环回 --- 192.168.1.0010 0000
L0 --- 192.168.1.0010 0000 --- 192.168.1.32/28
L1 --- 192.168.1.0011 0000 --- 192.168.1.48/28
R2环回 --- 192.168.1.0100 0000
L0 --- 192.168.1.0100 0000 --- 192.168.1.64/28
L1 --- 192.168.1.0101 0000 --- 192.168.1.80/28
R3子网 --- 192.168.1.0110 0000 --- 192.168.1.96/27
R4环回 --- 192.168.1.1000 0000
L0 --- 192.168.1.1000 0000 --- 192.168.1.128/28
L1 --- 192.168.1.1001 0000 --- 192.168.1.144/28
R5环回 --- 192.168.1.1010 0000 --- 192.168.1.160/27
192.168.1.1100 0000 --- 闲置
192.168.1.1110 0000 --- 闲置
结果:
配置IP
R1:
The device is running!
<R1>
Mar 18 2024 08:50:27-08:00 R1 %%01IFPDT/4/IF_STATE(l)[0]:Interface GigabitEthern
et0/0/0 has turned into UP state.
<R1>
Mar 18 2024 08:50:27-08:00 R1 %%01IFPDT/4/IF_STATE(l)[1]:Interface GigabitEthern
et0/0/1 has turned into UP state.
<R1>system-view
Enter system view, return user view with Ctrl+Z.
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 30
Mar 18 2024 08:51:47-08:00 R1 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R1-GigabitEthernet0/0/0]quit
[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.1.9 30
Mar 18 2024 08:52:49-08:00 R1 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R1-GigabitEthernet0/0/1]quit
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 192.168.1.33 28
[R1-LoopBack0]quit
[R1]interface LoopBack 1
[R1-LoopBack1]ip address 192.168.1.49 28
[R1-LoopBack1]quit
[R1]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 5
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 5
The number of interface that is DOWN in Protocol is 1
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.1/30 up up
GigabitEthernet0/0/1 192.168.1.9/30 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack0 192.168.1.33/28 up up(s)
LoopBack1 192.168.1.49/28 up up(s)
NULL0 unassigned up up(s)
[R1]
R2:
The device is running!
<R2>system-view
Enter system view, return user view with Ctrl+Z.
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
Mar 18 2024 09:04:27-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]quit
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.1.5 30
Mar 18 2024 09:05:05-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]quit
[R2]interface LoopBack 0
[R2-LoopBack0]ip address 192.168.1.65 28
[R2-LoopBack0]quit
[R2]interface LoopBack 1
[R2-LoopBack1]ip address 192.168.1.81 28
[R2-LoopBack1]quit
[R2]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 5
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 5
The number of interface that is DOWN in Protocol is 1
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.2/30 up up
GigabitEthernet0/0/1 192.168.1.5/30 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack0 192.168.1.65/28 up up(s)
LoopBack1 192.168.1.81/28 up up(s)
NULL0 unassigned up up(s)
[R2]
R3:
The device is running!
<R3>sys
Enter system view, return user view with Ctrl+Z.
[R3]int g 0/0/0
[R3-GigabitEthernet0/0/0]ip add 192.168.1.10 30
Mar 18 2024 09:14:32-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]q
[R3]int g 0/0/1
[R3-GigabitEthernet0/0/1]ip add 192.168.1.13 30
Mar 18 2024 09:14:57-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]q
[R3]int g 0/0/2
[R3-GigabitEthernet0/0/2]ip add 192.168.1.97 27
Mar 18 2024 09:48:48-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]q
[R3]dis ip int b
*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.10/30 up up
GigabitEthernet0/0/1 192.168.1.13/30 up up
GigabitEthernet0/0/2 192.168.1.97/27 up up
NULL0 unassigned up up(s)
[R3]
R4:
The device is running!
<R4>sys
Enter system view, return user view with Ctrl+Z.
[R4]int g 0/0/0
[R4-GigabitEthernet0/0/0]ip add 192.168.1.6 30
[R4-GigabitEthernet0/0/0]
Mar 18 2024 09:17:01-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]q
[R4]int g 0/0/1
[R4-GigabitEthernet0/0/1]ip add 192.168.1.14 30
Mar 18 2024 09:17:29-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]int l 0
[R4-LoopBack0]ip add 192.168.1.129 28
[R4-LoopBack0]q
[R4]int l 1
[R4-LoopBack1]ip add 192.168.1.145 28
[R4-LoopBack1]q
[R4]int g 0/0/2
[R4-GigabitEthernet0/0/2]ip add 192.168.1.17 30
[R4-GigabitEthernet0/0/2]
Mar 18 2024 09:25:20-08:00 R4 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
[R4-GigabitEthernet0/0/2]q
[R4]int g 4/0/0
[R4-GigabitEthernet4/0/0]ip add 192.168.1.21 30
[R4-GigabitEthernet4/0/0]
Mar 18 2024 09:26:05-08:00 R4 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet4/0/0 has entered the UP state.
[R4-GigabitEthernet4/0/0]q
[R4]dis ip int b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 7
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 7
The number of interface that is DOWN in Protocol is 0
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.6/30 up up
GigabitEthernet0/0/1 192.168.1.14/30 up up
GigabitEthernet0/0/2 192.168.1.17/30 up up
GigabitEthernet4/0/0 192.168.1.21/30 up up
LoopBack0 192.168.1.129/28 up up(s)
LoopBack1 192.168.1.145/28 up up(s)
NULL0 unassigned up up(s)
[R4]
R5:
The device is running!
<R5>sys
Enter system view, return user view with Ctrl+Z.
[R5]int g 0/0/0
[R5-GigabitEthernet0/0/0]ip add 192.168.1.18 30
[R5-GigabitEthernet0/0/0]
Mar 18 2024 09:31:20-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]q
[R5]int g 0/0/2
[R5-GigabitEthernet0/0/2]ip add 192.168.1.22 30
Mar 18 2024 09:31:49-08:00 R5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
[R5-GigabitEthernet0/0/2]q
[R5]int g 0/0/1
[R5-GigabitEthernet0/0/1]ip add 12.0.0.1 24
Mar 18 2024 09:32:29-08:00 R5 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R5-GigabitEthernet0/0/1]q
[R5]int l 0
[R5-LoopBack0]ip add 192.168.1.161 27
[R5-LoopBack0]q
[R5]dis ip int b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 5
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 5
The number of interface that is DOWN in Protocol is 0
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.18/30 up up
GigabitEthernet0/0/1 12.0.0.1/24 up up
GigabitEthernet0/0/2 192.168.1.22/30 up up
LoopBack0 192.168.1.161/27 up up(s)
NULL0 unassigned up up(s)
[R5]
R6:
The device is running!
<R6>sys
Enter system view, return user view with Ctrl+Z.
[R6]int g 0/0/0
[R6-GigabitEthernet0/0/0]ip add 12.0.0.2 24
[R6-GigabitEthernet0/0/0]
Mar 18 2024 09:35:35-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]q
[R6]int l 0
[R6-LoopBack0]ip add 1.1.1.1 24
[R6-LoopBack0]q
[R6]dis ip int b
*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 2
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 2
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 12.0.0.2/24 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
LoopBack0 1.1.1.1/24 up up(s)
NULL0 unassigned up up(s)
[R6]
4、R3下面的两台PC通过DHCP自动获取IP地址;
DHCP配置
该网段通过R3与外界沟通,故在R3的0/0/2接口上配置DHCP服务:
<R3>sys
Enter system view, return user view with Ctrl+Z.
[R3]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[R3]ip pool a
Info: It's successful to create an IP address pool.
[R3-ip-pool-a]network 192.168.1.96 mask 27
[R3-ip-pool-a]gateway-list 192.168.1.97
[R3-ip-pool-a]dns-list 114.114.114.114
[R3-ip-pool-a]q
[R3]int g 0/0/2
[R3-GigabitEthernet0/0/2]dhcp select global
将PC的IP获取方式改为HDCP:
查看IP是否获取成功:
5、选路最佳,路由表尽量小,避免环路;
配置静态路由
R1:
<R1>sys
Enter system view, return user view with Ctrl+Z.
[R1]ip route-static 192.168.1.4 30 192.168.1.2
[R1]ip route-static 192.168.1.12 30 192.168.1.10
[R1]ip route-static 192.168.1.96 27 192.168.1.10
[R1]ip route-static 192.168.1.16 30 192.168.1.2
[R1]ip route-static 192.168.1.16 30 192.168.1.10
[R1]ip route-static 192.168.1.20 30 192.168.1.2
[R1]ip route-static 192.168.1.20 30 192.168.1.10
[R1]ip route-static 0.0.0.0 0 192.168.1.2
[R1]ip route-static 192.168.1.64 27 192.168.1.2
[R1]ip route-static 192.168.1.128 27 192.168.1.2
[R1]ip route-static 192.168.1.128 27 192.168.1.10
[R1]ip route-static 192.168.1.160 27 192.168.1.2
[R1]ip route-static 192.168.1.160 27 192.168.1.10
R2:
<R2>sys
Enter system view, return user view with Ctrl+Z.
[R2]ip route-static 192.168.1.32 27 192.168.1.1
[R2]ip route-static 192.168.1.8 30 192.168.1.1
[R2]ip route-static 192.168.1.96 27 192.168.1.1
[R2]ip route-static 192.168.1.96 27 192.168.1.6
[R2]ip route-static 192.168.1.12 30 192.168.1.6
[R2]ip route-static 0.0.0.0 0 192.168.1.6
R3:
<R3>sys
Enter system view, return user view with Ctrl+Z.
[R3]ip route-static 192.168.1.32 27 192.168.1.9
[R3]ip route-static 192.168.1.0 30 192.168.1.9
[R3]ip route-static 192.168.1.64 27 192.168.1.9
[R3]ip route-static 192.168.1.64 27 192.168.1.14
[R3]ip route-static 192.168.1.4 30 192.168.1.14
[R3]ip route-static 0.0.0.0 0 192.168.1.14
R4:
<R4>sys
Enter system view, return user view with Ctrl+Z.
[R4]ip route-static 192.168.1.32 27 192.168.1.5
[R4]ip route-static 192.168.1.32 27 192.168.1.13
[R4]ip route-static 192.168.1.8 30 192.168.1.13
[R4]ip route-static 192.168.1.96 27 192.168.1.13
[R4]ip route-static 192.168.1.0 30 192.168.1.5
[R4]ip route-static 192.168.1.64 27 192.168.1.5
[R4]ip route-static 192.168.1.160 27 192.168.1.18
[R4]ip route-static 192.168.1.160 27 192.168.1.22
[R4]ip route-static 0.0.0.0 0 192.168.1.18
[R4]ip route-static 0.0.0.0 0 192.168.1.22
R5:
<R5>sys
Enter system view, return user view with Ctrl+Z.
[R5]ip route-static 0.0.0.0 0 192.168.1.17
[R5]ip route-static 0.0.0.0 0 192.168.1.21
[R5]ip route-static 1.1.1.0 24 12.0.0.2
由此内网全通
6、R1-R5均可以访问R6的环回;
NET设置
使用ACL抓取流量:
<R5>sys
Enter system view, return user view with Ctrl+Z.
[R5]acl 2000
[R5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
在R5上配置easy ip:
[R5-acl-basic-2000]q
[R5]int g 0/0/1
[R5-GigabitEthernet0/0/1]nat outbound 2000
完成访问公网:
7、R6 telnet R5的公有地址时,实际登录到R1上;
Telnet及端口映射
R1配置telnet:
<R1>sys
Enter system view, return user view with Ctrl+Z.
[R1]aaa
[R1-aaa]local-user a1 privilege level 15 password cipher 123456
Info: Add a new user.
[R1-aaa]local-user a1 service-type telnet
[R1-aaa]user-interface vty 0 4
[R1-ui-vty0-4]authentication-mode aaa
在R5配置端口映射:
<R5>sys
Enter system view, return user view with Ctrl+Z.
[R5]int g 0/0/1
[R5-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 23 ins
ide 192.168.1.1 23
Warning:The port 23 is well-known port. If you continue it may cause function fa
ilure.
Are you sure to continue?[Y/N]:y
尝试访问:
8、R4与R5正常通过1000M链路,故障时通过100m链路;
16/30网段为1000M,20/30网段为100M。
使用静态路由设置优先级:
R4:
因为静态路由默认优先级为60,所以只需要把100M的优先级调大即可:
[R4]ip route-static 0.0.0.0 0 192.168.1.22 preference 61
Info: Succeeded in modifying route.
Mar 22 2024 08:44:17-08:00 R4 %%01RM/4/IPV4_DEFT_RT_CHG(l)[0]:IPV4 default Route
is changed. (ChangeType=Delete, InstanceId=0, Protocol=Static, ExitIf=GigabitEt
hernet4/0/0, Nexthop=192.168.1.22, Neighbour=0.0.0.0, Preference=1023410176, Lab
el=NULL, Metric=0)
[R4]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 29 Routes : 31
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 Static 60 0 RD 192.168.1.18 GigabitEthernet
0/0/2
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.0/30 Static 60 0 RD 192.168.1.5 GigabitEthernet
0/0/0
192.168.1.4/30 Direct 0 0 D 192.168.1.6 GigabitEthernet
0/0/0
192.168.1.6/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.1.7/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.1.8/30 Static 60 0 RD 192.168.1.13 GigabitEthernet
0/0/1
192.168.1.12/30 Direct 0 0 D 192.168.1.14 GigabitEthernet
0/0/1
192.168.1.14/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
192.168.1.15/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
192.168.1.16/30 Direct 0 0 D 192.168.1.17 GigabitEthernet
0/0/2
192.168.1.17/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
192.168.1.19/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
192.168.1.20/30 Direct 0 0 D 192.168.1.21 GigabitEthernet
4/0/0
192.168.1.21/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
4/0/0
192.168.1.23/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
4/0/0
192.168.1.32/27 Static 60 0 RD 192.168.1.5 GigabitEthernet
0/0/0
Static 60 0 RD 192.168.1.13 GigabitEthernet
0/0/1
192.168.1.64/27 Static 60 0 RD 192.168.1.5 GigabitEthernet
0/0/0
192.168.1.96/27 Static 60 0 RD 192.168.1.13 GigabitEthernet
0/0/1
192.168.1.128/28 Direct 0 0 D 192.168.1.129 LoopBack0
192.168.1.129/32 Direct 0 0 D 127.0.0.1 LoopBack0
192.168.1.143/32 Direct 0 0 D 127.0.0.1 LoopBack0
192.168.1.144/28 Direct 0 0 D 192.168.1.145 LoopBack1
192.168.1.145/32 Direct 0 0 D 127.0.0.1 LoopBack1
192.168.1.159/32 Direct 0 0 D 127.0.0.1 LoopBack1
192.168.1.160/27 Static 60 0 RD 192.168.1.18 GigabitEthernet
0/0/2
Static 60 0 RD 192.168.1.22 GigabitEthernet
4/0/0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
[R4]
R5:
与上面同理:
<R5>sys
Enter system view, return user view with Ctrl+Z.
[R5]dis ip rou
[R5]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 18 Routes : 19
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 Static 60 0 RD 192.168.1.17 GigabitEthernet
0/0/0
Static 60 0 RD 192.168.1.21 GigabitEthernet
0/0/2
1.1.1.0/24 Static 60 0 RD 12.0.0.2 GigabitEthernet
0/0/1
12.0.0.0/24 Direct 0 0 D 12.0.0.1 GigabitEthernet
0/0/1
12.0.0.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
12.0.0.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.16/30 Direct 0 0 D 192.168.1.18 GigabitEthernet
0/0/0
192.168.1.18/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.1.19/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.1.20/30 Direct 0 0 D 192.168.1.22 GigabitEthernet
0/0/2
192.168.1.22/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
192.168.1.23/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
192.168.1.160/27 Direct 0 0 D 192.168.1.161 LoopBack0
192.168.1.161/32 Direct 0 0 D 127.0.0.1 LoopBack0
192.168.1.191/32 Direct 0 0 D 127.0.0.1 LoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
[R5]ip route-static 0.0.0.0 0 192.168.1.21 preference 61
Info: Succeeded in modifying route.
Mar 22 2024 08:49:44-08:00 R5 %%01RM/4/IPV4_DEFT_RT_CHG(l)[0]:IPV4 default Route
is changed. (ChangeType=Delete, InstanceId=0, Protocol=Static, ExitIf=GigabitEt
hernet0/0/2, Nexthop=192.168.1.21, Neighbour=0.0.0.0, Preference=1023410176, Lab
el=NULL, Metric=0)
[R5]
[R5]dis ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 18 Routes : 18
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 Static 60 0 RD 192.168.1.17 GigabitEthernet
0/0/0
1.1.1.0/24 Static 60 0 RD 12.0.0.2 GigabitEthernet
0/0/1
12.0.0.0/24 Direct 0 0 D 12.0.0.1 GigabitEthernet
0/0/1
12.0.0.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
12.0.0.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.16/30 Direct 0 0 D 192.168.1.18 GigabitEthernet
0/0/0
192.168.1.18/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.1.19/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.1.20/30 Direct 0 0 D 192.168.1.22 GigabitEthernet
0/0/2
192.168.1.22/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
192.168.1.23/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
192.168.1.160/27 Direct 0 0 D 192.168.1.161 LoopBack0
192.168.1.161/32 Direct 0 0 D 127.0.0.1 LoopBack0
192.168.1.191/32 Direct 0 0 D 127.0.0.1 LoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
[R5]
优先级低的条目将暂时不会显示在路由条目上。
配置完成