CCNA learning - routing and switching - simple configuration interface

接口配置是最重要的路由器配置之一,因为若没有接口,路由器几乎就毫无用处。另外,要与其他设备通信,接口配置必须绝对精确。配置接口时,我们需要指定网络层地址、介质类型和带宽,还需使用其他管理命令。

Enable Interface

To disable the interface, we can use the interface configuration command to the shutdown ; To enable the interface, we can use the command NO the shutdown .
If the interface is disabled, the command show interfaces output (abbreviated as sh int), the display interface is administratively down (down):

Todd#sh int f0/1
FastEthernet0/1 is administratively down , line protocol is down
[output cut] 

Another way to check the status of the interface is to use the command show running-config. By default, all interfaces are disabled. To enable the interface, we can use the command no shutdown (abbreviated no shut):

Todd#config t
Todd(config)#int fOjl
Todd(config-if)#no shutdown
Todd(config-if)#
* July 17 15:05:08.455: %LINK-3-UPDOWN: Interface FastEthernet0/1,
changed state to up
Todd(config-if)#do show int f0/1
FastEthernet0/1 is up , line protocol is up
[output cut]

To configure the IP address of the interface

Interface mode using the command ip address:

Todd(config)#int f0/1
Todd(config-if)#ip address 172.16.10.2 255.255.255.0
Todd(config-if)#no shutdown

Do not forget to use the command no shutdown enabled interface. Do not forget to view the command show interface int output, to see whether the interface is administratively down. Command show running-config provide such information.
/ n

Interface add a secondary IP address:

If you give the second address configuration interface, you need to use the command Secondary :

Todd(config-if)#ip address 172.16.20.2 255.255.255.0 secondary
Todd(config-if)#^Z
Todd(config-if)#do sh run
Building configuration...
[output cut]
interface FastEthernet0/1
   ip address 172.16.20.2 255.255.255.0 secondary
   ip address 172.16.10.2 255.255.255.0
   duplex auto
   speed auto
!

Guess you like

Origin blog.51cto.com/14416969/2421051