Switch# show interface type mod/num switchport
Switch# show interface gigabitethernet 0/1 switchport Name: Gi0/1 Switchport: Disabled Switch#
Switch(config)# interface type mod/num
Switch(config-if)# switchport
Switch(config)# interface type mod/num
Switch(config-if)# no switchport
Switch(config-if)# ip address ip-address mask [secondary]
Switch(config)# interface vlan vlan-id
Switch(config-if)# ip address ip-address mask [secondary]
Switch(config-if)# no shutdown
AUTOSTATE:
Podmínky za kterých je SVI UP díky autostate:
Př. Na switchi je definována VLAN2, je do ní přiřazeno několik interfejsů, ale žádný není aktivní
Switch(config)#interface vlan2 Switch(config-if)# *Apr 21 10:13:10.949: %LINK-3-UPDOWN: Interface Vlan2, changed state to up Switch(config-if)# Switch(config-if)#ip address 192.168.1.1 255.255.255.0 Switch(config-if)#^Z
Switch# show ip interface brief Interface IP-Address OK? Method Status Protocol Vlan1 unassigned YES manual administratively down down Vlan2 192.168.1.1 YES manual up down FastEthernet1/0/1 unassigned YES unset down down FastEthernet1/0/2 unassigned YES unset down down
Připojení PC k jednomu z portů ve VLAN2:
Switch# *Apr 21 10:21:31.925: %LINK-3-UPDOWN: Interface FastEthernet1/0/1, changed state to up *Apr 21 10:21:32.009: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan2, changed state to up *Apr 21 10:21:32.932: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0/1, changed state to up Switch#
Odpojení PC od portu:
Switch# *Apr 21 10:21:45.624: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0/1, changed state to down *Apr 21 10:21:45.624: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan2, changed state to down *Apr 21 10:21:46.622: %LINK-3-UPDOWN: Interface FastEthernet1/0/1, changed state to down
Zajistí, že tento int. nebude mít vliv na stav SVI:
Switch(config-if)# switchport autostate exclude