接上一篇: CCNA综合实验(一):实验实现(Ⅰ)

http://shenghao.blog.51cto.com/5890026/1194949

 

2.广域网链路配置要求:

R1R2之间封装PPP,采用PAP方式认证;R2R3之间封装PPP,采用CHAP认证。

  • 路由器基本配置

Router(config)#ho R1

R1(config)#line console 0

R1(config-line)#no exe

R1(config-line)#logging s

R1(config-line)#exi

R1(config)#no ip domain lo

R1(config)#int s0/0

R1(config-if)#ip add 192.168.1.113 255.255.255.252

R1(config-if)#no shut

 

%LINK-5-CHANGED: Interface Serial0/0, changed state to down

R1(config-if)#clock rate 64000

R1(config-if)#int f0/0

R1(config-if)#ip add 192.168.1.33 255.255.255.224

R1(config-if)#no shut

 

R1(config-if)#

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

 

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

 

R1(config-if)#int lo 0

 

R1(config-if)#

%LINK-5-CHANGED: Interface Loopback0, changed state to up

 

%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up

 

R1(config-if)#ip add 192.168.1.10 255.255.255.248

 

  • R1R2之间封装PPP,采用PAP方式认证

R1(config)#username R2 password ccnp

R1(config)#int s0/0

R1(config-if)#enca

R1(config-if)#encapsulation ppp

R1(config-if)#ppp authen

R1(config-if)#ppp authentication pap

R1(config-if)#

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down

 

R1(config-if)#ppp pap sent-username R1 pass

R1(config-if)#ppp pap sent-username R1 password ccna

R1(config-if)#

 

R2(config)#username R1 password ccna

R2(config)#int s0/0

R2(config-if)#en

R2(config-if)#encapsulation ppp

R2(config-if)#ppp authen

R2(config-if)#ppp authentication pap

R2(config-if)#ppp pap sent

R2(config-if)#ppp pap sent-username R2 pass 0 ccnp

R2(config-if)#

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up

 

R2(config-if)#

 

R2(config-if)#do ping 192.168.1.113

 

Type escape sequence to abort.

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

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/9 ms

 

R2(config-if)#

 

  • R2R3之间封装PPP,采用CHAP认证

R2(config)#int s0/1

R2(config-if)#en

R2(config-if)#encapsulation ppp

R2(config-if)#

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to down

 

R2(config-if)#

 

R3(config)#int s0/0

R3(config-if)#en

R3(config-if)#encapsulation ppp

R3(config-if)#

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up

 

R3(config-if)#

 

R2(config)#username R3 password cisco

R2(config)#int s0/1

R2(config-if)#ppp authen

R2(config-if)#ppp authentication chap

R2(config-if)#

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to down

 

R2(config-if)#

 

R3(config)#username R2 password cisco

R3(config)#int s0/0

R3(config-if)#

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up

 

R3(config-if)#ppp auth

R3(config-if)#ppp authentication chap

R3(config-if)#

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down

 

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up

 

R3(config-if)#

 

3.R1连的PC动态的获取IP地址-DHCP

R1(config)#ip dhcp pool R1_DHCP

R1(dhcp-config)#network 192.168.1.32 255.255.255.224

R1(dhcp-config)#default

R1(dhcp-config)#default-router 192.168.1.33

R1(dhcp-config)#exi

R1(config)#ip dhcp ex

R1(config)#ip dhcp excluded-address 192.168.1.33 192.168.1.43

R1(config)#

查看PC1获取地址情况

PC>ipconfig

 

FastEthernet0 Connection:(default port)

Link-local IPv6 Address.........: FE80::206:2AFF:FE6A:7E03

IP Address......................: 192.168.1.44

Subnet Mask.....................: 255.255.255.224

Default Gateway.................: 192.168.1.33

 

4.三层路由功能

全网运行OSPF路由协议,要求如下:

使用精确的通配符掩码将必要的接口加入OSPF进程,本地进程号为X

所有接口包括环回接口都属于骨干区域,禁止额外的区域;

路由器ID使用环回接口的地址;

 

  • R1(config)#router ospf 1

R1(config-router)#do show ip int b

Interface              IP-Address      OK? Method Status                Protocol

 

FastEthernet0/0        192.168.1.33    YES manual up                    up

 

FastEthernet0/1        unassigned      YES unset  administratively down down

 

Serial0/0              192.168.1.113   YES manual up                    up

 

Loopback0              192.168.1.10    YES manual up                    up

R1(config-router)#network 192.168.1.33 0.0.0.0 area 0

R1(config-router)#network 192.168.1.113 0.0.0.0 area 0

R1(config-router)#network 192.168.1.10 0.0.0.0 area 0

R1(config-router)#

 

  • R2(config)#router ospf 1

    R2(config-router)#network 192.168.1.97 0.0.0.0 area 0

R2(config-router)#network 192.168.1.129 0.0.0.0 area 0

R2(config-router)#network 192.168.1.193 0.0.0.0 area 0

R2(config-router)#network 192.168.1.114 0.0.0.0 area 0

R2(config-router)#network 192.168.1.117 0.0.0.0 area 0

01:34:19: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.1.10 on Serial0/0 from LOADING to FULL, Loading Done

 

R2(config-router)#network 192.168.1.117 0.0.0.0 area 0

R2(config-router)#network 192.168.1.20 0.0.0.0 area 0

R2(config-router)#network 10.1.1.1 0.0.0.0 area 0

R2(config-router)#

 

  • R3(config)#router ospf 1

R3(config-router)#network 192.168.1.65 0.0.0.0 area 0

R3(config-router)#network 192.168.1.118 0.0.0.0 area 0

R3(config-router)#network 192.168.1.118 0.0.0.0 area 0

01:35:44: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.1.20 on Serial0/0 from LOADING to FULL, Loading Done

 

R3(config-router)#network 192.168.1.30 0.0.0.0 area 0

R3(config-router)#

 

  • R2(config)#do show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

       * - candidate default, U - per-user static route, o - ODR

       P - periodic downloaded static route

 

Gateway of last resort is not set

 

C    10.0.0.0/8 is directly connected, FastEthernet0/1

     192.168.1.0/24 is variably subnetted, 12 subnets, 6 masks

O       192.168.1.10/32 [110/65] via 192.168.1.113, 00:03:14, Serial0/0

C       192.168.1.16/29 is directly connected, Loopback0

O       192.168.1.30/32 [110/65] via 192.168.1.118, 00:01:29, Serial0/1

O       192.168.1.32/27 [110/65] via 192.168.1.113, 00:03:14, Serial0/0

O       192.168.1.64/27 [110/65] via 192.168.1.118, 00:01:29, Serial0/1

C       192.168.1.96/28 is directly connected, FastEthernet0/0.1

C       192.168.1.112/30 is directly connected, Serial0/0

C       192.168.1.113/32 is directly connected, Serial0/0

C       192.168.1.116/30 is directly connected, Serial0/1

C       192.168.1.118/32 is directly connected, Serial0/1

C       192.168.1.128/26 is directly connected, FastEthernet0/0.11

C       192.168.1.192/26 is directly connected, FastEthernet0/0.12

R2(config)#

  • 对交换机设置telnet密码,测试telnet

要为交换机设置默认网关,不然无法telnet

PC4 telnet SW1

PC>telnet 192.168.1.98

Trying 192.168.1.98 ...Open

 

 

User Access Verification

 

Password:

SW1>en

Password:

SW1#

SW1#

 

PC2 telnet SW3

PC>telnet 192.168.1.100

Trying 192.168.1.100 ...Open

 

 

User Access Verification

 

Password:

SW3>en

Password:

SW3#

SW3#