实验目的:

1、掌握接口的开启和关闭。

2、掌握接口地址和描述符配置。

3、掌握接口双工模式和速率配置。

实验拓扑:

实验步骤:

1、为路由器接口配置IP地址之前,先查看接口状态,如下:

R1#show ip interface brief

Interface        IP-Address  OK?  Method      Status        Protocol

FastEthernet0/0  unassigned  YES  unset  administratively down down  

可以看到,默认情况下,路由器接口关闭,处于“down/down”状态,Status标识接口物理状态,Protocol标识接口链路或协议状态。一般当物理层处于down时,例如网线没插好、网口被关闭等,链路或者协议状态都是down。

2、为R1开启快速以太网口,并配置IP地址,如下:

R1(config)#int f0/0

R1(config-if)#no shutdown

R1(config-if)#ip address 12.1.1.1 255.255.255.0

R1(config-if)#exit

查看接口信息

R1#show ip int brief

Interface      IP-Address     OK? Metho   Status             Protocol

FastEthernet0/0    12.1.1.1    YES manual   up                  down

可以看到,此时路由器接口处于“up/down”状态,当本地物理接口开启,但是链路对方有故障时或者协议故障时,则会出现此状况。

3、为R2开启快速以太网口,并配置IP地址,如下:

R2(config)#int f0/0

R2(config-if)#no shutdown

R2(config-if)#ip address 12.1.1.2 255.255.255.0

R2(config-if)#exit

查看接口信息

R1#show ip int brief

Interface      IP-Address     OK? Metho   Status             Protocol

FastEthernet0/0    12.1.1.1    YES manual   up                  up


R2#show ip int brief

Interface       IP-Address    OK? Method  Status             Protocol

FastEthernet0/0   12.1.1.2     YES manual   up                  up

可以看到,此时双方接口状态处于“up/up”状态,表示接口正常。

4、为接口配置描述符,如下:

R1(config)#int f0/0

R1(config-if)#description "Connect to PingingLab*CCIE-Lab*R2"

R1(config-if)#end

查看接口描述符信息

R1#show run int f0/0

Building configuration...

Current configuration : 143 bytes

interface FastEthernet0/0

 description "Connect to PingingLab*CCIE-Lab*R2"

接口描述符可以使管理员更好的理解网络环境,方便故障排错。

5、为接口配置双工模式和速率,如下:

R1(config)#int f0/0

R1(config-if)#duplex full

R1(config-if)#speed 100

R1(config-if)#exit

查看接口双工模式

R1#show interfaces f0/0

FastEthernet0/0 is up, line protocol is up

  Hardware is AmdFE, address is cc00.1edc.0000 (bia cc00.1edc.0000)

  Description: "Connect to PingingLab*CCIE-Lab*R2"

  Internet address is 12.1.1.1/24

  MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,

     reliability 255/255, txload 1/255, rxload 1/255

  Encapsulation ARPA, loopback not set

  Keepalive set (10 sec)

  Full-duplex, 100Mb/s, 100BaseTX/FX

  ARP type: ARPA, ARP Timeout 04:00:00

  Last input 00:00:04, output 00:00:02, output hang never

  Last clearing of "show interface" counters never

  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0

  Queueing strategy: fifo

  Output queue: 0/40 (size/max)

  5 minute input rate 0 bits/sec, 0 packets/sec

  5 minute output rate 0 bits/sec, 0 packets/sec

     39 packets input, 11998 bytes

Received 39 broadcasts, 0 runts, 0 giants, 0 throttles

     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored

     0 watchdog

     0 input packets with dribble condition detected

     411 packets output, 42281 bytes, 0 underruns

     0 output errors, 0 collisions, 7 interface resets

     0 babbles, 0 late collision, 0 deferred

     0 lost carrier, 0 no carrier

     0 output buffer failures, 0 output buffers swapped out

链路的双工模式和速率必须一致,一般快速以太网默认为全双工,100Mbps速率。

6、测试直连连通性,如下:

R1#ping 12.1.1.2


Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 12.1.1.2, timeout is 2 seconds:

.!!!!

Success rate is 80 percent (4/5), round-trip min/avg/max = 28/47/56 ms

此时,R1和R2之间可以正常通信。

接口管理对于后续的高级协议部署非常重要,一般运行其他协议之前,都要保证直连连通。此实验完成。