三层交换vlan互访配置的show ip route
时间: 2023-11-09 11:04:43 浏览: 135
在三层交换机上配置VLAN互访后,可以使用show ip route命令查看路由表信息。以下是一个示例配置和输出:
假设我们有一个名为VLAN10的VLAN和一个名为VLAN20的VLAN,在交换机上配置了它们之间的互访,如下所示:
```
interface VLAN10
ip address 192.168.10.1 255.255.255.0
!
interface VLAN20
ip address 192.168.20.1 255.255.255.0
!
ip routing
!
interface gigabitEthernet0/1
switchport mode access
switchport access vlan 10
!
interface gigabitEthernet0/2
switchport mode access
switchport access vlan 20
```
使用show ip route命令可以查看到路由表信息,例如:
```
Switch# show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is not set
C 192.168.10.0/24 is directly connected, VLAN10
C 192.168.20.0/24 is directly connected, VLAN20
```
在这个示例中,我们可以看到两条C代码(直连)路由,分别对应VLAN10和VLAN20。这意味着交换机已经能够正确地识别这些VLAN,并且可以在它们之间路由数据。
阅读全文