实验02 VLAN与单臂路由

实验02 VLAN与单臂路由
一、拓扑图
 
实验02 VLAN与单臂路由_第1张图片
 
二、实验目标
1.  实现小型企业局域网二层广播域VLAN隔离和三层全网全连通。
2.  掌握VLANTrunk、单臂路由的配置方法。
3.  分析PC1 ping PC4 的三层通信过程和二层通信过程。
4.  分析PC4 ping SW4网管地址的三层通信过程和二层通信过程。
 
三、实验内容
1SW3SW4RT5的基本信息配置
Switch(config-line)# logging synchronous
Switch(config-line)# exec-timeout 0 0
Switch(config-line)# no login
Switch(config-line)#line aux 0
Switch(config-line)# logging synchronous
Switch(config-line)# exec-timeout 0 0
Switch(config-line)# no login
Switch(config-line)# privilege level 15
Switch(config-line)#line vty 0 4
Switch(config-line)# no login
Switch(config-line)# privilege level 15
Switch(config-line)#exit
Switch(config)#no cdp run
Switch(config)#no ip http server
2)创建Vlan

SW4#vlan database
SW4(vlan)#vlan 8
VLAN 8 added:
    Name: VLAN0008
SW4(vlan)#vlan 10
VLAN 10 added:
    Name: VLAN0010
SW4(vlan)#vlan 11
VLAN 11 added:
    Name: VLAN0011
SW4(vlan)#exi
APPLY completed.
Exiting....
SW3#vlan database
SW3(vlan)#vlan 8
VLAN 8 added:
    Name: VLAN0008
SW3(vlan)#vlan 10
VLAN 10 added:
    Name: VLAN0010
SW3(vlan)#vlan 11
VLAN 11 added:
    Name: VLAN0011
SW3(vlan)#exi
APPLY completed.
Exiting....

3SW3的二层接口配置
SW3(config)#interface fastEthernet 0/10
SW3(config-if)#switchport mode access
SW3(config-if)#switchport access vlan 10
SW3(config-if)#exit
SW3(config)#interface fastEthernet 0/11
SW3(config-if)#switchport mode access
SW3(config-if)#switchport access vlan 11
SW3(config-if)#exit
SW3(config)#interface fastEthernet 0/1
SW3(config-if)#switchport trunk encapsulation dot1q
SW3(config-if)#switchport mode trunk
*Mar  1 00:03:59.883: %DTP-5-TRUNKPORTON: Port Fa0/1 has become dot1q trunk
SW3(config-if)#switchport trunk allowed vlan all
SW3(config-if)#switchport trunk native vlan 8
SW3(config-if)#exit
SW3(config)#interface fastEthernet 0/3
SW3(config-if)#switchport trunk encapsulation dot1q
SW3(config-if)#switchport mode trunk
*Mar  1 00:04:43.355: %DTP-5-TRUNKPORTON: Port Fa0/3 has become dot1q trunk
SW3(config-if)#switchport trunk allowed vlan all
SW3(config-if)#exit
SW4 的二层接口配置
SW4(config)#interface fastEthernet 0/10
SW4(config-if)#switchport mode access
SW4(config-if)#switchport access vlan 10
SW4(config-if)#exit
SW4(config)#interface fastEthernet 0/11
SW4(config-if)#switchport mode access
SW4(config-if)#switchport access vlan 11
SW4(config-if)#exit
SW4(config)#interface fastEthernet 0/3
SW4(config-if)#switchport trunk encapsulation dot1q
SW4(config-if)#switchport mode trunk
*Mar  1 00:12:18.667: %DTP-5-TRUNKPORTON: Port Fa0/3 has become dot1q trunk
SW4(config-if)#switchport trunk allowed vlan all
SW4(config-if)#exit
(4)SW3 网管IP
SW3(config)#interface vlan 8
*Mar  1 00:04:56.091: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan8, changed state to up
SW3(config-if)#ip address 192.168.8.130 255.255.255.128
SW3(config-if)#no shutdown
SW3(config-if)#exit
SW3(config)#ip default-gateway 192.168.8.129
   SW4 网管IP
SW4(config)#interface vlan 8
*Mar  1 00:12:29.119: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan8, changed state to up
SW4(config-if)#ip add 192.168.8.131 255.255.255.128
SW4(config-if)#no shutdown
SW4(config-if)#exit
SW4(config)#ip default-gateway 192.168.8.129
(5)RT5 的三层接口配置
RT5(config)#interface ethernet 0/0
RT5(config-if)#ip ad
RT5(config-if)#ip address 192.168.8.129 255.255.255.128
RT5(config-if)#no shutdown
*Mar  1 00:31:00.243: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
*Mar  1 00:31:01.243: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up
RT5(config-if)#exit
RT5(config-subif)#interface ethernet 0/0.10            
RT5(config-subif)#encapsulation dot1Q 10
RT5(config-subif)#ip address 192.168.10.1 255.255.255.0
RT5(config-subif)#no shutdown
RT5(config-subif)#exit
RT5(config)#interface ethernet 0/0.11
RT5(config-subif)#encapsulation dot1Q 11
RT5(config-subif)#ip address 192.168.11.1 255.255.255.0
RT5(config-subif)#no shutdown
RT5(config-subif)#exit
 
RT5#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
Ethernet0/0                192.168.8.129   YES manual up                    up     
Ethernet0/0.10             192.168.10.1    YES manual up                    up     
Ethernet0/0.11             192.168.11.1    YES manual up                    up     
Ethernet0/1                unassigned      YES unset  administratively down down   
Ethernet0/2                unassigned      YES unset  administratively down down   
Ethernet0/3                unassigned      YES unset  administratively down down   
 
四、测试结果
       设备
PC1
PC2
PC3
PC4
SW3
SW4
RT5
192.168.10.10
192.168.10.20
192.168.11.10
192.168.11.20
192.168.8.130
192.168.8.131
192.168.8.129
192.168.10.1
192.168.11.1
 
、遇到的问题及思考
在配置虚拟子接口的时候忘记输入encapsulation dot1q 10/11的命令,总查找不到已经配入的IP,后来才发现原因。这句命令的作用是允许 Vlan10/Vlan11的数据进入,并给出去的数据打上Vlan10/Vlan11的标签。
 
六、实验心得
单臂路由是一个简单却很重要的技术,这个实验虽然简单,却让我们很好的了解了单臂路由的原理以及基本配置方法,但是方法虽然简单,一些细节部分还是要注意。

本文出自 “IT入门” 博客,谢绝转载!

你可能感兴趣的:(职场,VLAN,休闲,单臂路由)