查看路由器上的接口状态

1
display ip interface brief

display ip interface brief命令用来查看接口与IP相关的简要信息,包括IP地址、子网掩码、物理状态和协议状态以及处于不同状态的接口数目等。

查看路由器上的路由表情况

1
display ip routing-table

配置路由物理接口的IP地址

R1

1
2
3
4
5
6
[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]ip address 10.0.13.1 24
[R1-GigabitEthernet0/0/1]quit
[R1]interface GigabitEthernet 0/0/3
[R1-GigabitEthernet0/0/3]ip address 10.0.12.1 24
[R1-GigabitEthernet0/0/3]quit

R2

1
2
3
4
5
6
[R2]interface GigabitEthernet 0/0/3
[R2-GigabitEthernet0/0/3]ip address 10.0.12.2 24
[R2-GigabitEthernet0/0/3]quit
[R2]interface GigabitEthernet 0/0/2
[R2-GigabitEthernet0/0/2]ip address 10.0.23.2 24
[R2-GigabitEthernet0/0/2]quit

R3

1
2
3
4
5
6
[R3]interface GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1]ip address 10.0.13.3 24
[R3-GigabitEthernet0/0/1]quit
[R3]interface GigabitEthernet 0/0/2
[R3-GigabitEthernet0/0/2]ip address 10.0.23.3 24
[R3-GigabitEthernet0/0/2]quit

联通性测试

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[R1]ping 10.0.12.2
PING 10.0.12.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.12.2: bytes=56 Sequence=1 ttl=255 time=80 ms
Reply from 10.0.12.2: bytes=56 Sequence=2 ttl=255 time=50 ms
Reply from 10.0.12.2: bytes=56 Sequence=3 ttl=255 time=40 ms
Reply from 10.0.12.2: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 10.0.12.2: bytes=56 Sequence=5 ttl=255 time=10 ms

--- 10.0.12.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/42/80 ms

[R1]ping 10.0.13.3
PING 10.0.13.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.13.3: bytes=56 Sequence=1 ttl=255 time=60 ms
Reply from 10.0.13.3: bytes=56 Sequence=2 ttl=255 time=50 ms
Reply from 10.0.13.3: bytes=56 Sequence=3 ttl=255 time=40 ms
Reply from 10.0.13.3: bytes=56 Sequence=4 ttl=255 time=10 ms
Reply from 10.0.13.3: bytes=56 Sequence=5 ttl=255 time=50 ms

--- 10.0.13.3 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/42/60 ms

查看R1的路由表

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[R1]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 6 Routes : 6

Destination/Mask Proto Pre Cost Flags NextHop Interface

10.0.12.0/24 Direct 0 0 D 10.0.12.1 GigabitEthernet 0/0/3
10.0.12.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/3
10.0.13.0/24 Direct 0 0 D 10.0.13.1 GigabitEthernet 0/0/1
10.0.13.1/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

5.创建并配置