enable
configure terminal
interface vlan 10
description MANAGEMENT
ip address 192.168.10.2 255.255.255.0
no shutdown
exit
ip default-gateway 192.168.10.1
end
write memory
show ip interface brief enable
configure terminal
interface vlan 10
description MANAGEMENT
ip address 192.168.10.2 255.255.255.0
no shutdown
exit
ip routing
ip route 0.0.0.0 0.0.0.0 192.168.10.1
end
write memory
show ip route | include 0.0.0.0 Switch> enable
Switch# configure terminal
Switch(config)# Switch(config)# interface vlan 1
Switch(config-if)# description Management SVI Switch(config-if)# ip address 192.168.10.2 255.255.255.0 Switch(config-if)# no shutdown
Switch(config-if)# end
Switch# Switch(config)# vlan 10
Switch(config-vlan)# name MANAGEMENT
Switch(config)# interface gi1/0/10
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10
Switch(config-if)# no shutdown Switch(config)# ip default-gateway 192.168.10.1 Switch# show ip interface brief
Switch# show running-config | section interface Vlan
Switch# show running-config | include ip default-gateway Switch(config)# interface vlan 10
Switch(config-if)# ip address dhcp
Switch(config-if)# no shutdown Switch(config)# interface gigabitEthernet1/0/1
Switch(config-if)# no switchport
Switch(config-if)# ip address 10.0.0.2 255.255.255.252
Switch(config-if)# no shutdown Switch# show ip interface brief
Switch# ping 192.168.10.1 Switch# write memory
! или
Switch# copy running-config startup-config Switch# show mac address-table interface gi1/0/10
Switch# show ip arp
Switch# show ip arp | include 0011.2233.4455 Router# show ip arp | include 192.168.10.100
Protocol Address Age (min) Hardware Addr Type Interface
Internet 192.168.10.100 0 0011.2233.4455 ARPA Vlan10 Switch# show cdp neighbors detail
! опционально
Switch# show lldp neighbors detail Switch(config)# hostname SW1
Switch(config)# ip domain-name example.local
Switch(config)# username admin privilege 15 secret STRONG_SECRET
Switch(config)# crypto key generate rsa modulus 2048
Switch(config)# line vty 0 4
Switch(config-line)# login local
Switch(config-line)# transport input ssh
Switch(config-line)# ip ssh version 2 Switch(config)# ip access-list standard MGMT_ONLY
Switch(config-std-nacl)# permit 192.168.10.0 0.0.0.255
Switch(config-std-nacl)# deny any log
Switch(config)# line vty 0 4
Switch(config-line)# access-class MGMT_ONLY in
Switch(config-line)# transport input telnet ssh Switch# show interface vlan 10
Switch# show vlan brief
Switch# show interfaces trunk
Switch# show spanning-tree vlan 10 Switch(config)# interface gi1/0/1
Switch(config-if)# switchport trunk allowed vlan add 10
Switch(config-if)# no shutdown Switch# show ip arp
Switch# show logging
Switch# show ip dhcp snooping binding %IP-4-DUPADDR: Duplicate address 192.168.10.2 on Vlan10, sourced by 0011.2233.4455 Switch# show interfaces trunk
Port Mode Encapsulation Status Native vlan
Gi1/0/1 on 802.1q trunking 1
Port Vlans allowed on trunk
Gi1/0/1 1-4094
Port Vlans allowed and active in management domain
Gi1/0/1 1,10,20
Port Vlans in spanning tree forwarding state and not pruned
Gi1/0/1 1,10,20 Switch(config)# ip access-list standard MGMT_ONLY
Switch(config-std-nacl)# permit 192.168.10.0 0.0.0.255
Switch(config-std-nacl)# deny any log
Switch(config)# line vty 0 4
Switch(config-line)# access-class MGMT_ONLY in Switch(config)# banner motd ^
Unauthorized access is prohibited. All activity is logged.
^