So, we need to configure a network interface on a Cisco router or switch from the same vendor. Let's play around with this hardware and see what can be done.
Selecting an interfaceFirst we need to enter the network interface configuration mode (roughly speaking - the network card). I.e., all management operations happen from a specific location - when you are inside the configuration mode of a particular interface.
So, we run:
> enable
# config t
(config)# interface FastEthernet 0/0
(config-if)#
Here, obviously, you need to replace the interface FastEthernet 0/0 with the one you are going to configure. In Cisco terms, interfaces are named as follows (the main ones):
- Ethernet: 10Mbit/s interface (RJ45)
- FastEthernet: 10/100Mbit/s interface (RJ45)
- GigabitEthernet: 10/100/1000Mbit/s interface (RJ45)
- Vlan: accordingly, a virtual interface of a specific VLAN
I.e., in order to, for example, configure the second network card on a Cisco 18xx router, we specify "FastEthernet 0/1", and to configure the network interface for VLAN 205, we use the following: "Vlan 205".
So, having entered the command described above we end up in the configuration mode of the selected interface, from where we can now tinker with it.
Setting the IP address
(config-if)# ip address 192.168.0.1 255.255.255.0
As you can see, the syntax is very simple - instead of "192.168.0.1 255.255.255.0" specify the IP address and mask you need.
Enabling and disabling a network interfaceAn especially useful note for the case when you enter "show interface" and in the output you see that the line for the interface you need reads:
FastEthernet 0/0 is administratively down
I.e., the interface has been "shut down", or disabled, by the administrator. How to enable it?
To enable:
(config-if)# no shutdown
To disable:
(config-if)# shutdown
Setting the speed mode
(config-if)# speed 100
For each interface type there may be different available modes. For example, for FastEthernet the following modes are available:
100 : 100Mbit/s (forced)
10 : 10Mbit/s (forced)
auto : auto-negotiation
For a gigabit interface, 1000 is also added - i.e., to force gigabit usage.
This directive is not available for VLAN interfaces.
Setting duplex
(config-if)# duplex full
Accordingly:
- full: full-duplex mode - data can be received and sent at the same time
- half: half-duplex - at any given moment data can either be received or sent, but not both at once
- auto: auto-negotiation - the connected devices negotiate the fastest mode available between them
Setting the MAC address
(config-if)# mac-address 001A.2304.558A
Here it's a bit unusual. We're used to specifying each byte of the MAC address separately (for example, "00-1A-23-04-55-8A"). Cisco, however, "glues" pairs of bytes into words, so the MAC address in the example will look like this: "001A.2304.558A".
Setting the ARP time-to-live (TTL)Network equipment stores a table of MAC addresses with their corresponding IP addresses (obtained via ARP) in its memory. However, after a certain period of inactivity, the stored MAC=IP binding should be removed. This parameter specifies (in seconds) how long to wait before removing a MAC entry from the table.
(config-if)# arp timeout 600
Comments