GNS3 distribution across vlan vlan communication experiment

 A, assignment VLAN in a switch

 Build a network topology, assign a VLAN in a switch, the switch 3725 CISCO router using imitation

 Start all devices, and configure the IP address for each PC

PC1> ip 192.168.0.101 255.255.255.0
Checking for duplicate address...
PC1 : 192.168.0.101 255.255.255.0


PC2> ip 192.168.0.102 255.255.255.0
Checking for duplicate address...
PC1 : 192.168.0.102 255.255.255.0

PC3> ip 192.168.0.103 255.255.255.0
Checking for duplicate address...
PC1 : 192.168.0.103 255.255.255.0

PC4> ip 192.168.0.104 255.255.255.0
Checking for duplicate address...
PC1 : 192.168.0.104 255.255.255.0

Next, VLAN id assigned for each port in the switch. Establishing two VLAN in the switch, id 10 and 20 respectively

ESW1#vlan d
% Warning: It is recommended to configure VLAN from config mode,
  as VLAN database mode is being deprecated. Please consult user
  documentation for configuring VTP/VLAN in config mode.

ESW1(vlan)#vlan 10 name vlan10
VLAN 10 modified:
    Name: vlan10
ESW1(vlan)#vlan 20 name vlan20
VLAN 20 modified:
    Name: vlan20
ESW1(vlan)#apply
APPLY completed.
ESW1(vlan)#exit
APPLY completed.
Exiting....

 

F1 is assigned VLAN 10/1 f1 / 2, for the f1 / 3 f1 / 4 dispensing VLAN20

ESW1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
ESW1(config)#int f1/1
ESW1(config-if)#switchport mode access
ESW1(config-if)#switchport access vlan 10
ESW1(config-if)#exit
ESW1(config)#int f1/2
ESW1(config-if)#switchport mode access
ESW1(config-if)#switchport access vlan 10
ESW1(config-if)#exit
ESW1(config)#int f1/3
ESW1(config-if)#switchport mode access
ESW1(config-if)#switchport access vlan 20
ESW1(config-if)#ex
ESW1(config)#int f1/4
ESW1(config-if)#switchport access vlan 20
ESW1(config-if)#exit

When configuring f1 / 4 We do not set the port type to access, but the resulting effect is the same, indicating that the default switch port type is access

and may only be access type information is marked as allocated by the VLAN id, such as port f1 / 4 assignment VLAN id 20, the tag message is a message the switch 20 will be forwarded to the interface

Communication status of each PC after finished with VLAN

Second, the inter-switch VLAN assignment

Expand the network topology as follows

 

And assign IP addresses as above, PC5 and PC6 for the distribution id 192.168.0.105 and 192.168.0.106, similar, establishing two VLAN id in ESW2 10 and 20, respectively, and assigned to f1 / 1 and f1 / 2, respectively VLAN id 10 and 20

PC1 PC2 PC5 now belongs VLAN10, PC2 PC3 PC6 VLAN20 belongs, but not inter-switch communication trunk link aggregation needs to be configured on the two switches

ESW1 (config) #int F1 / 0
ESW1 (config-IF) #switchport trunk MODE
* 00-Mar. 1: 33 is: 06.135: the DTP-%-TRUNKPORTON. 5: Port FaI / 0 // has Become dot1q trunk (trunk can be seen the default type dot1q type of package, the trunk can be provided without encapsulation type)
ESW1 (config-IF) #switchport VLAN trunk allowed All
ESW1 (config-IF) #ex

ESW2(config)#int f1/0
ESW2(config-if)#switchport mode trunk
*Mar  1 00:24:00.687: %DTP-5-TRUNKPORTON: Port Fa1/0 has become dot1q trunk
ESW2(config-if)#switchport trunk allowed vlan all
ESW2(config-if)#exit

 

Can now communicate with each other PC1 PC2 PC5, PC2 PC3 PC6 can communicate with each other, but can not communicate with each other VLAN10 and VLAN20

Third, the use of one arm inter-VLAN routing experiments

Network topology is as follows

 

Wherein R1 is c3725 router, ESW R1 is connected to the network layer interface

The ESW of f1 / 5 is set to the same interface type between a trunk link aggregation, and provided two operation switches.

Start R1 is f0 / 0 interface, and configure the ip address and VLAN id f0 / 0 two sub-interfaces f0 / 0.1 and f0 / 0.2 of

R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config-if)#no shutdown
*Mar  1 00:03:33.375: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar  1 00:03:34.375: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config-if)#ex
R1(config)#int f0/0.1
R1(config-subif)#encapsulation dot1Q 10
*Mar  1 00:03:58.903: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
R1(config-subif)#ip address 192.168.0.1 255.255.255.0
R1(config-subif)#ex
R1(config)#int f0/0.2
R1(config-subif)#en
R1(config-subif)#encapsulation dot1Q 20
R1(config-subif)#ip address 192.168.1.1 255.255.255.0
R1(config-subif)#ex
R1(config)#exit

 

At this point you can see two sub-interfaces have been assigned an IP address, and is turned on

A sub-interface physical interface requires different network segments, so in order to make the sub-interface f0 / 0.2 PC can communicate VLAN 20, the third VLAN change the IP address of the host 20 to 1, and set the gateway as 192.168.1.1

If the host PC3

 

Host PC4 and PC6 are provided host ip 192.168.1.104 255.255.255.0 192.168.1.1 and ip 192.168.1.106 255.255.255.0 192.168.1.1

 

Add a gateway to a host of 192.168.0.1 VLAN10

As PC1

PC2 and PC5 are set ip 192.168.0.102 255.255.255.0 192.168.0.1 and ip 192.168.0.105 255.255.255.0 192.168.0.1

Open R1 routing function, the input at ip routing configuration environment

On PC1 in VLAN10 in pingVLAN20 in PC6

 

 

 

 

 

 

 

     

 

Published 15 original articles · won praise 3 · views 10000 +

Guess you like

Origin blog.csdn.net/biziwaiwai/article/details/103193112