要求
1.路由器上分别配置环回
2.连接路由器的线路网段为12.1.1.0/24、23.1.1.0/24
3.R1和R3连接的网络地址分别为192.168.1.0/24、192.168.2.0/24
4.整个网络使用RIP达到全网可达
1.路由器上分别配置环回
R1
<Huawei>SYS
Enter system view, return user view with Ctrl+Z.
[Huawei]
[Huawei]sys r1
[r1]inte
[r1]interface loop
[r1]interface LoopBack 0
[r1-LoopBack0]ip addr
[r1-LoopBack0]ip address 1.1.1.2 32
[r1-LoopBack0]quit
[r1]
R2
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r2
[r2]int
[r2]interface loo
[r2]interface LoopBack 0
[r2-LoopBack0]ip
[r2-LoopBack0]ip addr
[r2-LoopBack0]ip address 2.2.2.3 32
[r2-LoopBack0]quit
[r2]
R3
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r3
[r3]int
[r3]interface loo
[r3]interface LoopBack 0
[r3-LoopBack0]ip add
[r3-LoopBack0]ip address 3.3.3.4 32
[r3-LoopBack0]quit
[r3]
2.连接路由器的线路网段为12.1.1.0/24、23.1.1.0/24
R1
[r1]int
[r1]interface Giga
[r1]interface GigabitEthernet 0/0/1
[r1-GigabitEthernet0/0/1]ip add
[r1-GigabitEthernet0/0/1]ip address 12.1.1.1 24
Oct 23 2023 22:31:08-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r1-GigabitEthernet0/0/1]quit
[r1]
R2
[r2]int
[r2]interface Giga
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]ip add
[r2-GigabitEthernet0/0/0]ip address 12.1.1.2 24
Oct 23 2023 22:31:49-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]inte
[r2]interface Giga
[r2]interface GigabitEthernet 0/0/1
[r2-GigabitEthernet0/0/1]ip add
[r2-GigabitEthernet0/0/1]ip address 23.1.1.2 24
[r2-GigabitEthernet0/0/1]
Oct 23 2023 22:32:34-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]
R3
[r3]int
[r3]interface Giga
[r3]interface GigabitEthernet 0/0/0
[r3-GigabitEthernet0/0/0]ip add
[r3-GigabitEthernet0/0/0]ip address 23.1.1.3 24
Oct 23 2023 22:32:58-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]quit
[r3]
3.R1和R3连接的网络地址分别为192.168.1.0/24、192.168.2.0/24
R1与R3分别分配好网关192.168.1.1/24与192.168.2.1/24,并对网段进行宣告,宣告要求需要为主类宣告,因此需要先分掩码
1.1.1.1---->1.0.0.0
12.1.1.0---->12.0.0.0
2.2.2.2---->2.0.0.0
23.1.1.0---->23.0.0.0
3.3.3.3---->3.0.0.0
R1使用RIPv1进行宣告:
[r1]rip 1
[r1-rip-1]vers
[r1-rip-1]version 1
[r1-rip-1]net
[r1-rip-1]network 12.0.0.0
[r1-rip-1]net
[r1-rip-1]network 1.0
^
Error: Wrong parameter found at '^' position.
[r1-rip-1]network 1.0.0.0
[r1-rip-1]net
[r1-rip-1]network 192.168.1.0
Error: The specified network already exists in the process.
[r1-rip-1]rip
[r1-rip-1]q
[r1-rip-1]quit
[r1]disp
[r1]display ip rou
[r1]display ip routing-table pro
[r1]display ip routing-table protocol 1
^
Error: Unrecognized command found at '^' position.
[r1]display ip routing-table protocol rip
[r1]display ip routing-table protocol rip
[r1]display ip routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 4 Routes : 4
RIP routing table status : <Active>
Destinations : 4 Routes : 4
Destination/Mask Proto Pre Cost Flags NextHop Interface
2.0.0.0/8 RIP 100 1 D 12.1.1.2 GigabitEthernet
0/0/1
3.0.0.0/8 RIP 100 2 D 12.1.1.2 GigabitEthernet
0/0/1
23.0.0.0/8 RIP 100 1 D 12.1.1.2 GigabitEthernet
0/0/1
192.168.2.0/24 RIP 100 2 D 12.1.1.2 GigabitEthernet
0/0/1
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
R2使用RIPv1进行宣告:
[r2]rip 1
[r2-rip-1]ver
[r2-rip-1]vers
[r2-rip-1]version 1
[r2-rip-1]net
[r2-rip-1]network 23.0.0.0.
^
Error: Wrong parameter found at '^' position.
[r2-rip-1]network 23.0.0.0
[r2-rip-1]netwo
[r2-rip-1]network 12.0.0.0
[r2-rip-1]quit
[r2]rip 1
[r2-rip-1]vers
[r2-rip-1]version 1
[r2-rip-1]net
[r2-rip-1]network 2.0.0.0
[r2-rip-1]q
[r2]disp
[r2]display ip rou
[r2]display ip routing-table pro
[r2]display ip routing-table protocol rip
[r2]display ip routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 4 Routes : 4
RIP routing table status : <Active>
Destinations : 4 Routes : 4
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.0.0.0/8 RIP 100 1 D 12.1.1.1 GigabitEthernet
0/0/0
3.0.0.0/8 RIP 100 1 D 23.1.1.3 GigabitEthernet
0/0/1
192.168.1.0/24 RIP 100 1 D 12.1.1.1 GigabitEthernet
0/0/0
192.168.2.0/24 RIP 100 1 D 23.1.1.3 GigabitEthernet
0/0/1
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
R3使用RIPv1进行宣告:
[r3]rip 1
[r3-rip-1]vers
[r3-rip-1]version 1
[r3-rip-1]netw
[r3-rip-1]network 23.1.1.0
Error: The network address is invalid, and the specified address must be major-n
et address without any subnets.
[r3-rip-1]networ
[r3-rip-1]
Please check whether system data has been changed, and save data in time
Configuration console time out, please press any key to log on
<r3>sys
Enter system view, return user view with Ctrl+Z.
[r3]rip 1
[r3-rip-1]vers
[r3-rip-1]version 1
[r3-rip-1]netw
[r3-rip-1]network 23.0.0.0
[r3-rip-1]net
[r3-rip-1]network 3.3.3.3
Error: The network address is invalid, and the specified address must be major-n
et address without any subnets.
[r3-rip-1]network 3.0.0.0
[r3-rip-1]quit
[r3]disp
[r3]display ip ro
[r3]display ip routing-table pro
[r3]display ip routing-table protocol rip
[r3]display ip routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 4 Routes : 4
RIP routing table status : <Active>
Destinations : 4 Routes : 4
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.0.0.0/8 RIP 100 2 D 23.1.1.2 GigabitEthernet
0/0/0
2.0.0.0/8 RIP 100 1 D 23.1.1.2 GigabitEthernet
0/0/0
12.0.0.0/8 RIP 100 1 D 23.1.1.2 GigabitEthernet
0/0/0
192.168.1.0/24 RIP 100 2 D 23.1.1.2 GigabitEthernet
0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
4.整个网络使用RIP达到全网可达
使用PC1去ping PC3,如图