拓扑图
图2.1 静态路由和缺省路由实验拓扑图
场景
您是公司的网络管理员。现在公司有一个总部与一个分支机构。其中R1为总部路由器,R2为分支机构,总部与分支机构间通过以太网实现互连,且当前公司网络中没有配置任何路由协议。
由于网络的规模比较小,您可以配置通过静态路由和缺省路由来实现网络互通。IP编址信息如拓扑图所示。
操作步骤
步骤一 基础配置和IP编址
在R1、R2上配置设备名称和IP地址。
配置R1
<Huawei>system-view
[Huawei]sysname R1
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip address 10.1.1.254 255.255.255.0
[R1-GigabitEthernet0/0/0]quit
[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]ip address 10.1.12.1 24 255.255.255.0
[R1-GigabitEthernet0/0/1]quit
[R1]interface GigabitEthernet 0/0/2
[R1-GigabitEthernet0/0/2]ip address 10.1.22.1 24 255.255.255.0
[R1-GigabitEthernet0/0/2]quit
配置R2
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R2
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ip address 172.16.1.254 24
[R2-GigabitEthernet0/0/0]quit
[R2]interface GigabitEthernet0/0/1
[R2-GigabitEthernet0/0/1]ip add 10.1.12.2 24
[R2-GigabitEthernet0/0/1]quit
[R2]interface GigabitEthernet0/0/2
[R2-GigabitEthernet0/0/2]ip add 10.1.22.2 24
[R2-GigabitEthernet0/0/2]quit
执行display current-configuration命令,检查配置情况。
执行display ip interface brief命令,检查配置情况。
[R1]display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 10.1.1.254/24 up up
GigabitEthernet0/0/1 10.1.12.1/24 up up
GigabitEthernet0/0/2 10.1.22.1/24 up up
<R2>display ip interface brief
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 172.16.1.254/24 up up
GigabitEthernet0/0/1 10.1.12.2/24 up up
GigabitEthernet0/0/2 10.1.22.2/24 up up
配置好PC1、PC2的IP地址、子网掩码、网关。
执行ping命令,检测R1与直连网络的连通性。
<R1>ping 10.1.12.2
PING 10.1.12.2: 56 data bytes, press CTRL_C to break
Reply from 10.1.12.2: bytes=56 Sequence=1 ttl=255 time=120 ms
Reply from 10.1.12.2: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 10.1.12.2: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 10.1.12.2: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 10.1.12.2: bytes=56 Sequence=5 ttl=255 time=20 ms
<R1>ping 10.1.22.2
PING 10.1.22.2: 56 data bytes, press CTRL_C to break
Reply from 10.1.22.2: bytes=56 Sequence=1 ttl=255 time=130 ms
Reply from 10.1.22.2: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 10.1.22.2: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 10.1.22.2: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 10.1.22.2: bytes=56 Sequence=5 ttl=255 time=60 ms
<R1>ping 10.1.1.1
PING 10.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 10.1.1.1: bytes=56 Sequence=1 ttl=128 time=20 ms
Reply from 10.1.1.1: bytes=56 Sequence=2 ttl=128 time=20 ms
Reply from 10.1.1.1: bytes=56 Sequence=3 ttl=128 time=20 ms
Reply from 10.1.1.1: bytes=56 Sequence=4 ttl=128 time=20 ms
Reply from 10.1.1.1: bytes=56 Sequence=5 ttl=128 time=30 ms
执行ping命令,检测R2直连网络的连通性。
<R2>ping 172.16.1.2
PING 172.16.1.2: 56 data bytes, press CTRL_C to break
Reply from 172.16.1.2: bytes=56 Sequence=1 ttl=128 time=30 ms
Reply from 172.16.1.2: bytes=56 Sequence=2 ttl=128 time=30 ms
Reply from 172.16.1.2: bytes=56 Sequence=3 ttl=128 time=20 ms
Reply from 172.16.1.2: bytes=56 Sequence=4 ttl=128 time=30 ms
Reply from 172.16.1.2: bytes=56 Sequence=5 ttl=128 time=10 ms
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。