Assign the switch IP address
By default, Cisco switches perform Ethernet frames forwarding without any configuration. This means that you can buy a Cisco switch, plug in the right cables to connect various devices to the switch, power it on, and the switch should work. However, to perform switch managent over the network or use protocols such as SNMP, your switch will need to have an IP address.
The IP address is configured under a logical interface, known as the management domain or VLAN. Usually, the default VLAN 1 acts like the switch’s own NIC for connecting into a LAN to send IP packets. Here are the steps to configure an IP address under VLAN 1:
- enter the VLAN 1 configuration mode with the interface vlan 1 global configuration command.
- assign an IP address with the ip address IP_ADDRESS SUBNET_MASK interface subcommand.
- enable the VLAN 1 interface with the no shutdown interface subcommand.
- (Optional) use the ip default-gateway IP_ADDRESS global configuration command to configure the default gateway.
- (Optional) Add the ip name-server IP_ADDRESS global configuration command to configure the DNS server.
Here is a simple example:
We have a simple network of a single host and a switch. We can assign the switch with an IP address to enable IP communication between the two devices:
To verify the IP address set on a switch, we can use the show int vlan 1 command:
We can now ping SW1 from Host A:
Kuamua anwani ya IP ya switch: Kwa default, Cisco switches kufanya Ethernet frames forwarding bila configuration yoyote. Hii inamaanisha kwamba unaweza kununua kubadili Cisco, kuunganisha katika cables haki kuunganisha vifaa mbalimbali kwa kubadili, nguvu juu yake, na kubadili lazima kazi. Hata hivyo, kufanya kubadili manager juu ya mtandao au kutumia itifaki kama vile SNMP, kubadili yako itahitaji kuwa na anwani ya IP. Anwani ya IP imewekwa chini ya interface mantiki, inayojulikana kama uwanja wa usimamizi au VLAN. Kwa kawaida, default VLAN 1 vitendo kama kubadili mwenyewe NIC kwa kuunganisha katika LAN kutuma pakiti IP. "Kama ilivyoelezwa hapo juu, njia ya kuanzisha VLAN ni kwa kutumia ""VLAN 1 Global Configuration"" amri." "Kama vile, kwa mfano, ""IP Address Subnet Mask"" ni amri ya kiungo cha IP Subnet Mask." "VLAN 1 interface inaweza kuunganishwa na ""No Shutdown"" interface" - (Optional) kutumia ip default-gateway IP_ADDRESS amri ya muundo wa kimataifa kuanzisha mlango default. - (Optional) Kuongeza ip jina-server IP_ADDRESS amri ya muundo wa kimataifa ya kusanidi seva ya DNS. Hapa ni mfano rahisi: Tuna mtandao rahisi wa mwenyeji mmoja na kubadili. "Kama vile, unaweza kutumia anwani ya IP ya switch na kuamua ikiwa ni sahihi au la, kwa mfano, ""Show int vlan 1"" au ""Show int vlan 1"" (na sasa unaweza ping SW1 kutoka kwa mwenyeji A)."