6.7

完成计网的综合性训练(搭建中小企业园区网)

第一步:划分vlan

①  配置二层交换机S0

S0>enable

S0#config

Configuring from terminal, memory, or network [terminal]?

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

S0(config)#vlan 10

S0(config-vlan)#interface fastethernet 0/1

S0(config-if)#switchport access vlan 10

S0(config-if)#interface fastethernet 0/2

S0(config-if)#switchport access vlan 10

S0(config-if)#interface fastethernet 0/3

S0(config-if)#switchport access vlan 10

S0(config-if)#exit

 

②  配置二层交换机S1

S1>enable

S1#config

Configuring from terminal, memory, or network [terminal]?

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

S1(config)#vlan 15

S1(config-vlan)#interface fastethernet 0/1

S1(config-if)#switchport access vlan 15

S1(config-if)#interface fastethernet 0/2

S1(config-if)#switchport access vlan 15

S1(config-if)#interface fastethernet 0/3

S1(config-if)#switchport access vlan 15

S1(config-if)#end

③  配置二层交换机S2

Switch>enable

Switch#config

Configuring from terminal, memory, or network [terminal]?

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

Switch(config)#hostname S2

S2(config)#vlan 20

S2(config-vlan)#exit

S2(config)#interface vlan 20

S2(config-if)#

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

S2(config-if)#interface fastethernet 0/1

S2(config-if)#switchport access vlan 20

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to upS2(config-if)#

S2(config-if)#exit

S2(config)#interface fastethernet 0/2

S2(config-if)#switchport access vlan 20

S2(config-if)# interface fastethernet 0/3

S2(config-if)#switchport access vlan 20

S2(config-if)#end

④  配置二层交换机S3

Switch>enable

Switch#config

Configuring fr,om terminal, memory, or network [terminal]?

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

Switch(config)#hostname S3

S3(config)#vlan 25

S3(config-vlan)#exit

S3(config)#interface vlan 25

S3(config-if)#

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

S3(config-if)#interface fastethernet 0/1

S3(config-if)#switchport access vlan 25

 

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan25, changed state to upS3(config-if)#

S3(config-if)#exit

S3(config)#interface fastethernet 0/2

S3(config-if)#switchport access vlan 25

S3(config-if)# interface fastethernet 0/3

S3(config-if)#switchport access vlan 25

S3(config-if)#end

⑤  配置二层交换机S4

Switch>enable

Switch#config

Configuring fr,om terminal, memory, or network [terminal]?

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

Switch(config)#hostname S4

S4(config)#vlan 40

S4(config-vlan)#exit

S4(config)#interface vlan 40

S4(config-if)#

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

S4(config-if)#interface fastethernet 0/1

S4(config-if)#switchport access vlan 40

 

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan40, changed state to upS4(config-if)#

S4(config-if)#exit

S4(config)#interface fastethernet 0/2

S4(config-if)#switchport access vlan 40

S4(config-if)# interface fastethernet 0/3

S4(config-if)#switchport access vlan 40

S4(config-if)#end

⑥  配置二层交换机S5

Switch>enable

Switch#config

Configuring fr,om terminal, memory, or network [terminal]?

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

Switch(config)#hostname S5

S5(config)#vlan 45

S5(config-vlan)#exit

S5(config)#interface vlan 45

S5(config-if)#

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

S5(config-if)#interface fastethernet 0/1

S5(config-if)#switchport access vlan 45

 

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan45, changed state to upS5(config-if)#

S5(config-if)#exit

S5(config)#interface fastethernet 0/2

S5(config-if)#switchport access vlan 45

S5(config-if)# interface fastethernet 0/3

S5(config-if)#switchport access vlan 45

S5(config-if)#end

第二步:配置三层交换机(划分vlan,配置rip协议)

①  配置三层交换机

三层交换机Switch0

Switch>enable

Switch#config

Configuring from terminal, memory, or network [terminal]?

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

Switch(config)#vlan 20                  

Switch(config)#interface fastethernet0/1    

Switch(config-if)#switchport access vlan 20

Switch(config)#vlan 10                  

Switch(config)#interface fastethernet0/2   

Switch(config-if)#switchport access vlan 10

Switch(config)#vlan 15                     

Switch(config)#interface fastethernet0/3  

Switch(config-if)#switchport access vlan 15

Switch(config-if)#exit

Switch(config)#interface vlan 20

Switch(config-if)#ip address 192.168.7.2  255.255.255.0

Switch(config-if)#no shutdown               

Switch(config)#interface vlan 10

Switch(config-if)#ip address 192.168.1.1  255.255.255.0

Switch(config-if)#no shutdown               

Switch(config-if)#exit

Switch(config)#interface vlan 15

Switch(config-if)#ip address 192.168.2.1  255.255.255.0

Switch(config-if)#no shutdown  

②  配置三层交换机Switch1

Switch>enable

Switch#config

Configuring from terminal, memory, or network [terminal]?

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

Switch(config)#vlan 30

Switch(config-vlan)#interface fastethernet 0/1

Switch(config-if)#switchport access vlan 30

Switch(config-if)#exit

Switch(config)#vlan 20

Switch(config-vlan)#interface fastethernet 0/2

Switch(config-if)#switchport access vlan 20

Switch(config-if)#exit

Switch(config)#vlan 25

Switch(config-vlan)#interface fastethernet 0/3

Switch(config-if)#switchport access vlan 25

Switch(config-if)#exit

Switch(config)#interface vlan 30

Switch(config-if)#

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

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

Switch(config-if)#ip address 192.168.9.2 255.255.255.0

Switch(config-if)#no shutdown

Switch(config-if)#exit

Switch(config)#interface vlan 20

Switch(config-if)#

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

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

Switch(config-if)#ip address 192.168.3.1 255.255.255.0

Switch(config-if)#no shutdown

Switch(config-if)#exit

Switch(config)#interface vlan 25

Switch(config-if)#

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

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

Switch(config-if)#ip address 192.168.4.1 255.255.255.0

Switch(config-if)#no shutdown

Switch(config-if)#exit

③  配置三层交换机Switch2

Switch>enable

Switch#config

Configuring from terminal, memory, or network [terminal]?

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

Switch(config)#vlan 50

Switch(config-vlan)#interface fastethernet 0/1

Switch(config-if)#switchport access vlan 50

Switch(config-if)#exit

Switch(config)#vlan 40

Switch(config-vlan)#interface fastethernet 0/2

Switch(config-if)#switchport access vlan 40

Switch(config-if)#exit

Switch(config)#vlan 45

Switch(config-vlan)#interface fastethernet 0/3

Switch(config-if)#switchport access vlan 45

Switch(config-if)#exit

Switch(config)#interface vlan 50

Switch(config-if)#

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

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

Switch(config-if)#ip address 192.168.11.2 255.255.255.0

Switch(config-if)#no shutdown

Switch(config-if)#exit

Switch(config)#interface vlan 40

Switch(config-if)#

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

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

Switch(config-if)#ip address 192.168.5.1 255.255.255.0

Switch(config-if)#no shutdown

Switch(config-if)#exit

Switch(config)#interface vlan 45

Switch(config-if)#

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

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

Switch(config-if)#ip address 192.168.6.1 255.255.255.0

Switch(config-if)#no shutdown

Switch(config-if)#exit

第五步:配置路由器

①配置路由器R0

Router>enable

Router#config

Configuring from terminal, memory, or network [terminal]?

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

Router(config)#hostname R0

R0(config)#interface fastethernet 0/0

R0(config-if)#ip address 192.168.7.1 255.255.255.0

R0(config-if)#no shutdown

 

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

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

R0(config-if)#exit

R0(config)#interface serial 2/0

R0(config-if)#ip address 192.168.8.1 255.255.255.0

R0(config-if)#clock rate 64000

R0(config-if)#no shutdown

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

R0(config-if)#end

R0#

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

R0#

②配置路由器R1

Router>enable

Router#config

Configuring from terminal, memory, or network [terminal]?

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

Router(config)#interface fastethernet 0/0

Router(config-if)#ip address 192.168.11.1 255.255.255.0

Router(config-if)#no shutdown

 

%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)#interface serial 2/0

Router(config-if)#ip address 192.168.8.2 255.255.255.0

Router(config-if)#clock rate 64000

Router(config-if)#no shutdown

Router(config-if)#interface serial 3/0

Router(config-if)#ip address 192.168.10.1 255.255.255.0

Router(config-if)#clock rate 64000

Router(config-if)#no shutdown

 

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

Router(config-if)#end

Router#

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

Router#

③配置路由器R2

Router>enable

Router#config

Configuring from terminal, memory, or network [terminal]?

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

Router(config)#interface fastethernet 0/0

Router(config-if)#ip address 192.168.9.1 255.255.255.0

Router(config-if)#no shutdown

%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)#interface serial 2/0

Router(config-if)#ip address 192.168.10.2 255.255.255.0

Router(config-if)#clock rate 64000

Router(config-if)#no shutdown

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

Router(config-if)#end

Router#

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

Router#

第六步:验证通信情况

 

posted @ 2024-06-19 17:22  jais  阅读(16)  评论(0编辑  收藏  举报