GNS3 (Cisco) use of trunk cross-switch configuration vlan

  " Trunk" in network parlance usually translated as: "trunk, trunk, long-distance lines," but generally do not have Italian translation, direct English. Routing / switching network, trunk commonly referred to as a "relay (pass-through)." In applications in voice-grade line, generally refers Trunk circuit connection or channel between the "backbone network telephone trunk", i.e., two or exchange switch for switching it between two devices, and a signaling terminal data transmission link device. If you came to the real scene, in order to prevent the use of efficiency generated networks storm, pricey network bandwidth, we have to configure vlan dividing each working group to the corresponding working group among virtual local area network (vlan) go.

     As shown in the following figure: This chart simulate real business office environment. Here just three analog switches with six PC computers, but the reality in the work environment in which a PC with the switch much more. Because many computers, each PC side bandwidth available from the operator side and then allocated bandwidth would be less very poor. If you want to transfer some large-scale data, the use of the company's internal local area network transmission speed is definitely faster. Referring again to FIG, now the company's network management staff in order, the Ministry of Personnel is divided into three floors of a vlan (broadcast domain), and three floors of the sales division to another vlan them a go. If all the PC side are in a broadcast domain, then there will be a lot of problems specific explanation please refer to (https://blog.51cto.com/14451009/2427506 ( illustrated VLAN explain, let you read through it to understand VLAN )). VLAN settings across multiple switches function requires a Trunk, Trunk refers to a port capable of forwarding a plurality of different VLAN communication.

    First we have to configure two switches, because GNS3 from Dailu default, and switch settings no physical storage space, we're going to give it to add storage space to work with the board, specific pre-set switch, please refer to this blog https : //blog.51cto.com/14451009/2427554 (analog GNS3 Cisco (Cisco) implement static vlan function). My simulation environment is as follows, two PC connected switches 1, 2 2 PC connected to the switch. Finally, experimental purposes of the inter-switch PC1

PC3 now divided into the same vlan interoperability, and cross switch PC2 PC4 with the division were to go to another vlan.

1.png

    

 Switch configuration commands require the use of:

               1, R1 # configure terminal (conf t) into the global configuration mode

               2, R1 (config) #no ip routing routing function off

               3, R1 (config) #vlan * you add vlan number

               4, R1 (config) #interface fastEthernet * / * (int f * / *) representative of an access port port number setting mode *

              5, R1 (config-if) # switchport mode access (sw mo acc) port is provided access mode

               6, R1 (config-if) # switchport access vlan * (sw acc vlan *) to add the port number vlan vlan * represents

               7, R1 (config) #do show vlan-sw b show all the global mode is vlan

               8、R1(config-if)# switchport mode trunk   设置端口为中继模式

               9、R1(config-if)# switchport  trunk encapsulution dot1q   封装trunk端口IEEE802.1Q协议

               R1(config)代表在全局模式下    R1(config-if)代表在端口模式下  exit 是退出当前模式的命令  


 配置PC端就两条命令:1、配置IP地址 ip 0.0.0.0 0.0.0.0 (0代表具体的IP地址)

                                        2、ping  检测主机相互之间是否相连

    

   

这边我们需要非常注意的一点,初始的模拟交换机是没有一个物理的存储空间,我们要手动给他添加一些存储空间。如果不给他存储空的话,就无法保存我们的配置,如果它仅仅是要实现交换机功能的就不需要存储空间,但我们要给它一些vlan配置就需要一个存储数据的地方。这边我给它一个64Mib的空间。

2.png

   存储空间给完了之后,我们要配置一共工作单板,使它能够和我们的PC机用网线连接起来。这边添加一个16口的工作单板。

  


3.png

       工作单板添加好了,我们要给路由器更换成交换机的模型。然后拟定每一个PC的IP地址,和具体跟交换机的哪一个端口连接,如下图。



1.png


    


    如图下所示,我们拟定PC1(192.168.10.10.10),PC2(192.168.10.20),PC3(192.168.10.30),PC4(192.168.10.40)的IPC,实验目的把PC1跟PC3划入vlan 10,PC2跟PC4划入vlan20当中,实现一个跨交换机实现trunk的一个功能,下面我们先进入两个交换机把路由功能关闭,然后给各个PC机配上IP地址。


2.png

     现在我们已经进入交换机使用conf t(进入全局模式)和no ip routing(关闭路由功能)把默认自带的路由功能给它关闭了,接下来就是给各个PC机配上IP地址看看它们四个之间能否互联互通。


22.png

21.png

    如下图所示已经把各个PC机都配上IP地址了。PC1(192.168.10.10)  PC2(192.168.10.20)  PC3(192.168.10.30)跟PC4(192.168.10.40),接下来我们测试它们之间能不能互联互通。

31.png32.png

33.png34.png

       这边我使用ping命令测试了一下发现它们四台电脑之间可以互联互通,接下来进入重中之重的交换机的端口设置。

01.png02.png

03.png 

        接下来就是敲一系列的命令:

55.png

     下面解释各种命令,这边是交换机1,端口1/1连接的是PC1,而端口1/2则是连接着PC2,暂且我们交换机1的设置到这边下面进入交换机2的设置。

                          R1(config)#vlan 10,20                创建VLAN 10 跟20

                          R1(config-vlan)#ex                    退出vlan模式

                          R1(config)#int f1/1                     进入端口1/1

                          R1(config-if)#sw mo acc            设置端口为接入模式

                          R1(config-if)#sw acc vlan 10        把端口1/1添加为vlan10

                          R1(config-if)#int f1/2                    进入端口1/2

                          R1(config-if)#sw mo acc               设置端口为接入模式

                          R1(config-if)#sw acc vlan 20          把端口1/2添加为vlan20

56.png

    下面解释各种命令,这边是交换机2,端口1/1连接的是PC3,而端口1/2则是连接着PC4,最后一步就是把双方交换机的1/3接口设置为trunk模式就OK了。

                          R1(config)#vlan 10,20                创建VLAN 10 跟20

                          R1(config-vlan)#ex                    退出vlan模式

                          R1(config)#int f1/1                     进入端口1/1

                          R1(config-if)#sw mo acc            设置端口为接入模式

                          R1(config-if)#sw acc vlan 10        把端口1/1添加为vlan10

                          R1(config-if)#int f1/2                    进入端口1/2

                          R1(config-if)#sw mo acc               设置端口为接入模式

                          R1(config-if)#sw acc vlan 20          把端口1/2添加为vlan20



    As shown below using the int f1 / 3 1/3 command to enter both the port, then the port is set sw mo tr as trunk, then sw tr en do to a trunk port IEEE802.1Q protocol package, so that we All of the PC with all the switches are set up, and now we look vlan information.

41.png42.png

    As shown below, we 1/1 port two switches are added to the vlan 10, and were added to a 2-port VLAN20, next to the detection results of the time.

71.png72.png



     The original may not have been able to communicate with PC1 PC2 PC4 communicate with each other now, just can only communicate with PC3.

1.png

     And you can start with PC3 with PC2 PC1 now only communicate with each other and can only communicate with each other PC4, we have successfully simulated the realization of a function of a switch across the vlan.


2.png



                         

  





















 

   

Guess you like

Origin blog.51cto.com/14451009/2427841