GNS3 (analog Cisco) to achieve three-tier exchange function

    Please refer to the three-tier exchange not quite understand this blog https://blog.51cto.com/14451009/2427869 ( in-depth analysis of the working process of the three switches). Here we test the test environment three analog PC, a Layer 2 switching with a three-tier exchange.

1.png

   We develop the above experimental conditions, follow the steps we give the floor of the exchange with the three-tier exchange add physical storage space to work with the board.

   3.png

4.png

  Layer 2 switching to our exchange with three changes to the model, and enable them to develop and connect each PC with network cable IP address with vlan. According to the figure, the configuration PC1IP (192.168.10.10), PC2IP (192.168.20.10), PC3IP (192.168.30.10), the gateway address 10 three-tier exchange VLAN ( 192.168.10.1 ), VLAN 20 is ( 192.168.20.1 ), 30 VLAN ( 192.168.30.1 ). Then we enter the three-tier exchange is configured with the floor of the exchange.

5.png

   The exchange of two side configuration commands to use to have three

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

               2, Rl ( config) Close routing IP routing function #no

               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)  设置端口为接入模式

               6、R1(config-if)# switchport  access vlan *(sw acc vlan *) 把端口添加入vlan号   *代表vlan号

               7、R1(config)#do show vlan-sw b         显示所有vlan 是在全局模式

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

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

               10、no shut  开启端口

               11、R1(config-vlan)#ip * 在vlan模式下 创建网关地址

               12、R1(config)# do show ip int b 查看所以端口网关地址


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

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


    首先给三台模拟PC机都配上了相应的IP地址跟网关,接下来要进入二层交换进行设置。

                                     

1.png

  下图的命令解释:

R2#conf t                                      进入全局模式
R2(config)#no ip routing               关闭路由功能
R2(config)#vlan 10,20,30              添加vlan10 20 30
R2(config-vlan)#ex                       退出vlan模式
R2(config)#int f1/1                        进入端口1/1
R2(config-if)#sw mo acc               设置端口为接入模式
R2(config-if)#sw acc vlan 10         添加端口为vlan 10
R2(config-if)#int f1/2                      进入端口1/2

R2(config-if)#sw mo acc                设置端口为接入模式 
R2(config-if)#sw acc vlan 20         添加端口为vlan 20

R2(config-if)#int f1/3                      进入端口1/3

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

R2(config-if)#sw acc vlan 30         添加端口为vlan 30


2.png


     Then use do show vlan-sw b command to see whether each port has been added vlan, display has been added here the next step is to set the top of the 1/0 port as trunk.


4.png

6.png

   As shown on our floor of the exchange has been configured, the next step is to configure three-tier exchange.

7.png

   The specific steps performed according to the explanation on FIG. First step 1 with conf t command to enter global mode, create three vlan with vlan 10,20,30 and exit. Step 2 using int f1 / 0 1/0 command to enter the port, with the port sw mo t as trunk, sw t en dot is added to the protocol and exit port. Step 3 int vlan 10 vlan 10 enters the command set, then ip add 192.168.10.1 255.255.255.0 to set the gateway address 192.168.10.1 vlan 10. Step 4 Step 5 Step 3 with the same add with the gateway address 192.168.20.1 192.168.30.1 to vlan 20 with vlan 30. Here we are three routes on the set is complete. Then we use do show ip int b command back to check our settings, as shown we have for each vlan are set to the appropriate gateway address, use the following command to ping the PC side to test three different segments of PC performance No communication.

8.png

      As shown below with PC1 PC2 PC3 can connect with each other, PC2 and PC3 is also a perfect connection with each other, the experiment will be successful.

21.png

22.png





  




Guess you like

Origin blog.51cto.com/14451009/2427895