思科第六天

 1.

sw配置如下:

Switch>en

Switch#conf

Switch#configure t

Switch#configure terminal 

Enter configuration commands, one per line.  End with CNTL/Z.

Switch(config)#vlan 10

Switch(config-vlan)#exit

Switch(config)#

Switch(config)#vlan 20

Switch(config-vlan)#exit

Switch(config)#

Switch(config)#int fa0/10

Switch(config-if)#sw

Switch(config-if)#switchport acc

Switch(config-if)#switchport access 

Switch(config-if)#switchport access vlan 10

Switch(config-if)#exit

Switch(config)#

Switch(config)#int fa

Switch(config)#int fastEthernet 0/20

Switch(config-if)#sw

Switch(config-if)#switchport acc

Switch(config-if)#switchport access 

Switch(config-if)#switchport access vlan 20

Switch(config-if)#exit

Switch(config)#

Switch(config)#int vlan 10

Switch(config-if)#

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

 

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

 

Switch(config-if)#ip add

Switch(config-if)#ip address 192.168.1.1 255.255.255.0

Switch(config-if)#no shu

Switch(config-if)#no shutdown 

Switch(config-if)#exit

Switch(config)#int fa0/20

Switch(config-if)#ip add

Switch(config-if)#ip add

Switch(config-if)#exit

Switch(config)#

Switch(config)#int vlan 20

Switch(config-if)#

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

 

Switch(config-if)#

Switch(config-if)#ip add

Switch(config-if)#ip address 192.168.3.1 255.255.255.0

Switch(config-if)#no shu

Switch(config-if)#no shutdown 

Switch(config-if)#exit

Switch(config)#

Switch(config)#rou

Switch(config)#router os

Switch(config)#router ospf 1

Switch(config-router)#net

Switch(config-router)#network 192.168.1.0 0.0.0.255 ar

Switch(config-router)#network 192.168.1.0 0.0.0.255 area 0

Switch(config-router)#ne

Switch(config-router)#network 192.168.3.0 0.0.0.255 ar

Switch(config-router)#network 192.168.3.0 0.0.0.255 area 0

Switch(config-router)#exit

Switch(config)#

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

 

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

 

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

 

00:08:54: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.4.1 on Vlan20 from LOADING to FULL, Loading Done

 

Switch(config)#

Switch(config)#end

Switch#

%SYS-5-CONFIG_I: Configured from console by console

 

Switch#show ip rou

Switch#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

r1配置如下:

Router>

Router>en

Router>enable 

Router#conf

Router#configure t

Router#configure terminal 

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#int fa0/0

Router(config-if)#ip add

Router(config-if)#ip address 192.168.3.2 255.255.255.0

Router(config-if)#no shu

Router(config-if)#no shutdown 

 

Router(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

 

Router(config-if)#int se

Router(config-if)#exit

Router(config)#int se

Router(config)#int serial 2/0

Router(config-if)#cl

Router(config-if)#clock r

Router(config-if)#clock rate 64000

Router(config-if)#no shu

Router(config-if)#no shutdown 

 

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

Router(config-if)#

Router(config-if)#ip add

Router(config-if)#ip address 192.168.4.1 255.255.255.0

Router(config-if)#no shu

Router(config-if)#no shutdown 

Router(config-if)#exit

Router(config)#rou

Router(config)#router os

Router(config)#router ospf 1

Router(config-router)#net

Router(config-router)#network 192.168.4.0 0.0.0.255 ar

Router(config-router)#network 192.168.4.0 0.0.0.255 area 0

Router(config-router)#net

Router(config-router)#network 192.168.3.0 0.0.0.255 ar

Router(config-router)#network 192.168.3.0 0.0.0.255 area 0

Router(config-router)#exit

Router(config)#

00:09:14: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.3.1 on FastEthernet0/0 from LOADING to FULL, Loading Done

 

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

 

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

 

00:09:57: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.4.2 on Serial2/0 from LOADING to FULL, Loading Done

 

Router(config)#

Router(config)#end

Router#

%SYS-5-CONFIG_I: Configured from console by console

 

Router#show ip 

Router#show ip r

Router#show ip rou

Router#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

 

O    192.168.1.0/24 [110/2] via 192.168.3.1, 00:01:49, FastEthernet0/0

O    192.168.2.0/24 [110/782] via 192.168.4.2, 00:00:56, Serial2/0

C    192.168.3.0/24 is directly connected, FastEthernet0/0

C    192.168.4.0/24 is directly connected, S

r2配置如下:

Router>en

Router>enable 

Router#conf

Router#configure t

Router#configure terminal 

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#int se

Router(config)#int serial 2/0

Router(config-if)#ip add

Router(config-if)#ip address 192.168.4.2 255.255.255.0

Router(config-if)#no shu

Router(config-if)#no shutdown 

 

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

 

Router(config-if)#exit

Router(config)#int fa0/0

Router(config-if)#ip add

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

 

Router(config-if)#ip address 192.168.2.1 255.255.255.0

Router(config-if)#no shu

Router(config-if)#no shutdown 

 

Router(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

 

Router(config-if)#

Router(config-if)#exit

Router(config)#rou

Router(config)#router os

Router(config)#router ospf 1

Router(config-router)#ne

Router(config-router)#network 192.168.4.0 0.0.0.255 a

Router(config-router)#network 192.168.4.0 0.0.0.255 area 0

Router(config-router)#ne

Router(config-router)#network 192.168.2

00:09:56: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.4.1 on Serial2/0 from LOADING to FULL, Loading Done

.0 0.0.0.255 ar

Router(config-router)#network 192.168.2.0 0.0.0.255 area 0

Router(config-router)#exit

Router(config)#end

Router#

%SYS-5-CONFIG_I: Configured from console by console

 

Router#show ip rou

Router#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

 

O    192.168.1.0/24 [110/783] via 192.168.4.1, 00:01:15, Serial2/0

C    192.168.2.0/24 is directly connected, FastEthernet0/0

O    192.168.3.0/24 [110/782] via 192.168.4.1, 00:01:15, Serial2/0

C    192.168.4.0/24 is directly connected, Serial2/0

 

 

sw配置如下:

Switch>en

Switch#conf

Switch#configure t

Switch#configure terminal 

Enter configuration commands, one per line.  End with CNTL/Z.

Switch(config)#vlan 10

Switch(config-vlan)#exit

Switch(config)#vlan 20

Switch(config-vlan)#exit

Switch(config)#

Switch(config)#int fa0/10

Switch(config-if)#sw

Switch(config-if)#switchport acc

Switch(config-if)#switchport access v

Switch(config-if)#switchport access vlan 10

Switch(config-if)#no shu

Switch(config-if)#no shutdown 

Switch(config-if)#exi

Switch(config)#int fa0/20

Switch(config-if)#sw

Switch(config-if)#switchport acc

Switch(config-if)#switchport access vlan

Switch(config-if)#switchport access vlan 20

Switch(config-if)#no shu

Switch(config-if)#no shutdown 

Switch(config-if)#

Switch(config-if)#exit

Switch(config)#int vlan 10

Switch(config-if)#

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

 

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

 

Switch(config-if)#ip add

Switch(config-if)#ip address 192.168.1.1 255.255.255.0

Switch(config-if)#no shu

Switch(config-if)#no shutdown 

Switch(config-if)#exit

Switch(config)#int fa0/20

Switch(config-if)#ip add

Switch(config-if)#exit

Switch(config)#

Switch(config)#int vlan 20

Switch(config-if)#

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

 

Switch(config-if)#

Switch(config-if)#ip add

Switch(config-if)#ip address 192.168.2.1 255.255.255.0

Switch(config-if)#no s

Switch(config-if)#no shutdown 

Switch(config-if)#

Switch(config-if)#exit

Switch(config)#

Switch(config)#rou

Switch(config)#router rip

Switch(config)#router rip 

Switch(config-router)#ne

Switch(config-router)#network 192.168.2.0

Switch(config-router)#network 192.168.1.0

Switch(config-router)#v

Switch(config-router)#version 2

Switch(config-router)#exit

Switch(config)#

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

 

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

 

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

 

Switch(config)#

Switch(config)#end

Switch#

%SYS-5-CONFIG_I: Configured from console by console

 

Switch#show ip rou

Switch#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    192.168.1.0/24 is directly connected, Vlan10

C    192.168.2.0/24 is directly connected, Vlan20

R    192.168.3.0/24 [120/2] via 192.168.2.2, 00:00:30, Vlan20

R    192.168.4.0/24 [120/2] via 192.168.2.2, 00:00:30, Vlan20

 

r1配置如下:

Router>en

Router>enable 

Router#conf

Router#configure t

Router#configure terminal 

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#int 0/0

                   ^

% Invalid input detected at '^' marker.

Router(config)#int fa0/0

Router(config-if)#ip add

Router(config-if)#ip address 192.168.2.2 255.255.255.0

Router(config-if)#no shu

Router(config-if)#no shutdown 

 

Router(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

exit

Router(config)#

Router(config)#int fa1/0

%Invalid interface type and number

Router(config)#int fa0/1

Router(config-if)#no shu

Router(config-if)#no shutdown 

 

Router(config-if)#

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

 

Router(config-if)#ip add

Router(config-if)#ip address 192.168.3.1 255.255.255.0

Router(config-if)#no shu

Router(config-if)#no shutdown 

Router(config-if)#

Router(config-if)#exit

Router(config)#

Router(config)#rou

Router(config)#router rip

Router(config)#router rip 

Router(config-router)#ne

Router(config-router)#network 192.168.2.0

Router(config-router)#network 192.168.2.0

Router(config-router)#

Router(config-router)#v

Router(config-router)#version 2

Router(config-router)#exit

Router(config)#

Router(config)#rou

Router(config)#router osp

Router(config)#router ospf 1

Router(config-router)#ne

Router(config-router)#network 192.168.3.0 0.0.0.255 a

Router(config-router)#network 192.168.3.0 0.0.0.255 area 0

Router(config-router)#exit

Router(config)#

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

 

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

 

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

 

00:14:06: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.4.1 on FastEthernet0/1 from LOADING to FULL, Loading Done

 

Router(config)#

Router(config)#

Router(config)#rou

Router(config)#router rip

Router(config)#router rip 

Router(config-router)#re

Router(config-router)#redistribute ?

  connected  Connected

  eigrp      Enhanced Interior Gateway Routing Protocol (EIGRP)

  metric     Metric for redistributed routes

  ospf       Open Shortest Path First (OSPF)

  rip        Routing Information Protocol (RIP)

  static     Static routes

Router(config-router)#redistribute ospf

Router(config-router)#redistribute ospf 1

Router(config-router)#redistribute ospf 1 ?

  match   Redistribution of OSPF routes

  metric  Metric for redistributed routes

  <cr>

Router(config-router)#redistribute ospf 1 me

Router(config-router)#redistribute ospf 1 metric ?

  <0-16>       Default metric

  transparent  Transparently redistribute metric

Router(config-router)#redistribute ospf 1 metric 2

Router(config-router)#exit

Router(config)#

Router(config)#rou

Router(config)#router ospf 1

Router(config-router)#re

Router(config-router)#redistribute 

Router(config-router)#redistribute ?

  bgp        Border Gateway Protocol (BGP)

  connected  Connected

  eigrp      Enhanced Interior Gateway Routing Protocol (EIGRP)

  metric     Metric for redistributed routes

  ospf       Open Shortest Path First (OSPF)

  rip        Routing Information Protocol (RIP)

  static     Static routes

Router(config-router)#redistribute rip

Router(config-router)#redistribute rip s

Router(config-router)#redistribute rip subnets 

r2配置如下:

Router>en

Router>enable 

Router#conf

Router#configure t

Router#configure terminal 

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#

Router(config)#int fa0/0

Router(config-if)#ip add

Router(config-if)#ip address 192.168.3.2 255.255.255.0

Router(config-if)#no shu

Router(config-if)#no shutdown 

 

Router(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

 

Router(config-if)#exit

Router(config)#int fa1/0

%Invalid interface type and number

Router(config)#int fa0/1

Router(config-if)#noshu

Router(config-if)#noshu

                    ^

% Invalid input detected at '^' marker.

Router(config-if)#no shu

Router(config-if)#no shutdown 

 

Router(config-if)#

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

 

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

 

Router(config-if)#ip add

Router(config-if)#ip address 192.168.4.1 255.255.255.0

Router(config-if)#

Router(config-if)#

Router(config-if)#no shu

Router(config-if)#no shutdown 

Router(config-if)#

Router(config-if)#exit

Router(config)#rou

Router(config)#router os

Router(config)#router ospf 1

Router(config-router)#ne

Router(config-router)#network 192.168.4.0 0.0.0.255 a

Router(config-router)#network 192.168.4.0 0.0.0.255 area 0

Router(config-router)#net

Router(config-router)#network 192.168.3.0 0.0.0.255 ar

Router(config-router)#network 192.168.3.0 0.0.0.255 area 0

Router(config-router)#exir

                         ^

% Invalid input detected at '^' marker.

Router(config-router)#

Router(config-router)#

Router(config-router)#ex

Router(config)#

00:04:20: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.3.1 on FastEthernet0/0 from LOADING to FULL, Loading Done

 

 

 

 

本文出自 “筑梦小组-执行策划韦毅” 博客,谢绝转载!

你可能感兴趣的:(天,思科)