在三层交换机上配置路由,实现全网互通。
使用eNSP搭建实验环境
步骤
实现此案例需要按照如下步骤进行。
1)交换机配置见上一篇博客
三层交换机配置
2)配置路由
[SW3]vlan 6
[SW3]int g0/0/3
[SW3 -GigabitEthernet0/0/3]port link-type access
[SW3 -GigabitEthernet0/0/3]port default vlan 6
[SW3]int Vlanif 6
[SW3-Vlanif6]ip add 192.168.6.254 24
[SW3]ip route-static 192.168.7.0 255.255.255.0 192.168.6.1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.6.1 24
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 192.168.7.254 24
[R1]ip route-static 0.0.0.0 0.0.0.0 192.168.6.254
[R1]dis ip ro
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 11 Routes : 11
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 Static 60 0 RD 192.168.6.254 GigabitEthernet
0/0/0
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.6.0/24 Direct 0 0 D 192.168.6.1 GigabitEthernet
0/0/0
192.168.6.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.6.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.7.0/24 Direct 0 0 D 192.168.7.254 GigabitEthernet
0/0/1
192.168.7.254/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
192.168.7.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
- 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
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
3)测试PC间互通