交换机中使VLAN永久UP的方法

在做交换机实验的时候,可能会需要ping一个VLAN接口来做连通性测试,但VLAN中的端口必须连接设备之后VLAN才会是UP状态,那如何才能不连接设备还能方便的测试连通性呢?

S4600-28P-SI(config)#vlan 200
S4600-28P-SI(config-vlan200)#sw int e1/0/5-6
Set the port Ethernet1/0/5 access vlan 200 successfully
Set the port Ethernet1/0/6 access vlan 200 successfully
S4600-28P-SI(config-vlan200)#int e1/0/5
S4600-28P-SI(config-if-ethernet1/0/5)#loopback  //此处,将VLAN中的某个端口配置为loopback端口,使其永久UP
S4600-28P-SI(config-if-ethernet1/0/5)#
%Jan 01 00:07:48 2006 %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet1/0/5, changed state to UP
%Jan 01 00:07:49 2006 %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan200,changed state to UP
S4600-28P-SI(config-if-ethernet1/0/5)#int vlan 200
S4600-28P-SI(config-if-vlan200)#ip add 192.168.200.1 255.255.255.0
S4600-28P-SI(config-if-vlan200)#sho ip int b
Index Interface IP-Address Protocol
11001 Vlan1 unassigned down
11200 Vlan200 192.168.200.1 up
17500 Loopback 127.0.0.1 up

测试VLAN200接口是否可以ping通。

S4600-28P-SI#ping 192.168.200.1
Type ^c to abort.
Sending 5 56-byte ICMP Echos to 192.168.200.1, timeout is 2 seconds.
!!!!!    //已ping通
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms
S4600-28P-SI#

可以ping通,则目的达成。

此时,观察交换机端口的指示灯,可以发现,即便没接网线,其依然会神奇的亮起来。

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha Code