静态路由练习题
一、需求:
要求全网互通
二、个人思路:
- 首先完成左侧和右侧的单臂路由
- 再实现路由间的直连
- 使用静态路由手动添加IP地址
三、命令如下:
1.LSW4
The device is running!
<Huawei>undo ter mo
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]vlan bat 10 to 40 #创建vlan 10 20 30 40
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]port link-type acc #用access模式连接PC1
[Huawei-Ethernet0/0/1]port default vlan 10 #把PC1分到vlan 10 内
[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]port link-type acc
[Huawei-Ethernet0/0/2]port default vlan 20
[Huawei-Ethernet0/0/2]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk #用trunk模式连接路由器
[Huawei-GigabitEthernet0/0/1]port trunk all vlan all #允许所有vlan通过端口
2.LSW5
The device is running!
<Huawei>undo ter mo
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]vlan bat 10 to 40
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]port link-type ac
[Huawei-Ethernet0/0/1]port def vlan 30
[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]port link-type ac
[Huawei-Ethernet0/0/2]port def vlan 40
[Huawei-Ethernet0/0/2]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-t trunk
[Huawei-GigabitEthernet0/0/1]port trunk all vlan all
R6
The device is running!
<Huawei>undo ter mo
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]undo shutdown
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[Huawei-GigabitEthernet0/0/0]int g0/0/0.1 #建立子端口
[Huawei-GigabitEthernet0/0/0.1]vlan-type d 10 d #把vlan 10 划分入子端口
[Huawei-GigabitEthernet0/0/0.1]ip add 192.168.10.1 24 #添加网关
[Huawei-GigabitEthernet0/0/0.1]int g0/0/0.2
[Huawei-GigabitEthernet0/0/0.2]vlan-type d 20 d
[Huawei-GigabitEthernet0/0/0.2]ip add 192.168.20.1 24
[Huawei-GigabitEthernet0/0/0.2]q
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 10.1.1.2 24
[Huawei-GigabitEthernet0/0/1]q
[Huawei]ip route-static 192.168.30.0 24 10.1.1.3 #手动进行静态路由配置
[Huawei]ip route-static 192.168.40.0 24 10.1.1.3
R7
The device is running!
<Huawei>undo te mo
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]undo shutdown
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[Huawei-GigabitEthernet0/0/0]int g0/0/0.1
[Huawei-GigabitEthernet0/0/0.1]vlan-t d 30 d
[Huawei-GigabitEthernet0/0/0.1]ip add 192.168.30.1 24
[Huawei-GigabitEthernet0/0/0.1]int g0/0/0.2
[Huawei-GigabitEthernet0/0/0.2]vlan-t d 40 d
[Huawei-GigabitEthernet0/0/0.2]ip add 192.168.40.1 24
[Huawei-GigabitEthernet0/0/0.2]q
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 10.1.1.3 24
[Huawei-GigabitEthernet0/0/1]q
[Huawei]ip route-static 192.168.10.0 24 10.1.1.2
[Huawei]ip route-static 192.168.20.0 24 10.1.1.2
对不住各位,通信结果忘记了,不过人格担保能全网通信。