As we all know, VLANs exist for convenience of management and security. How to Create a Vlan?
Let me configure a simple Vlan network for communication between VLANs and between non-VLANs!
The parameters are as follows:
Vlan3: 172.28.255.255.255.255.0
Vlan5: 172.28.15.0 255.255.255.0
Vlan1: 172.28.16.0 255.255.255.0
Vlan4: 172.28.14.0 255.255.255.0
R. 11.11.1 255.255.255.0
R. 11.11.2 255.255.255.0
The network topology is as follows:
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/041133M61-0.jpg "title =" 7777.jpg" alt = "195103988.jpg"/>
Configure vswitch S1:
S1> enabl
S1 # conf ter
S1 (config) # int ran f0/1-2
S1 (config-if-range) # switch mode acce
S1 (config-if-range) # switch access vlan 3 // default vlan 3: VLAN0003
S1 (config-if-range) # exit
S1 (config) # int ran f0/3-4
S1 (config-if-range) # switch mode acce
S1 (config-if-range) # switch access vlan 5 // create vlan 5 by default: VLAN0005
S1 (config-if-range) # exit
S1 (config) # int f0/24
S1 (config-if) # switch mode trunk // configure the relay Port
Configure router R1:
R1> enabl
R1 # conf ter
R1 (config) # int f0/0.3 // configure the virtual channel
R1 (config-subif) # encap dot1Q 3 // configure vlan 3 Encapsulation
R1 (config-subif) # ip address 172.28.13.1 255.255.255.0
R1 (config-subif) # no shut
R1 (config-subif) # exit
R1 (config) # int f0/0.5 // configure the virtual channel
R1 (config-subif) # encap dot1Q 5 // configure vlan 5 Encapsulation
R1 (config-subif) # ip address 172.28.15.1 255.255.255.0
R1 (config-subif) # no shut
R1 (config-subif) # exit
R1 (config) # int f0/1
R1 (config-if) # ip address 172.28.16.1 255.255.0 // configure the gateway of the 172.28.16.0 network segment
R1 (config-if) # no shut
R1 (config-if) # exit
R1 (config) # ip rout 172.28.12.0 255.255.255.0 11.11.11.2 // configure a static route
R1 (config) # ip rout 172.28.12.0 255.255.255.0 11.11.11.2
Configure vswitch S4:
S4> enabl
S4 # conf ter
S4 (config) # int ran f0/1-2
S4 (config-if-range) # switch mode acce
S4 (config-if-range) # switch access vlan 4 // create vlan 4 by default: VLAN0004
S4 (config-if-range) # exit
S4 (config) # int f0/24
S4 (config-if) # switch mode trunk // configure the relay Port
Configure vror2 R2:
R2> enabl
R2 # conf ter
R2 (config) # int f0/1.4 // configure the virtual channel
R2 (config-subif) # encap dot1Q 4 // configure vlan 4 Encapsulation
R2 (config-subif) # ip address 172.28.14.1 255.255.255.0
R2 (config-subif) # no shut
R2 (config-subif) # exit
R2 (config) # int f0/0
R2 (config-if) # ip address 172.28.12.1 255.255.0 // configure the gateway of the 172.28.12.0 network segment
R2 (config-if) # no shut
R2 (config-if) # exit
R2 (config) # ip rout 172.28.255.255.255.255.0 11.11.11.1 // configure a static route
R2 (config) # ip rout 172.28.15.0 255.255.255.0 11.11.11.1
R2 (config) # ip rout 172.28.16.0 255.255.255.0 11.11.11.1
In fact, the static routes of R1 and R2 can be configured as default routes, because they all have only one route egress,
Default route:
R1 (config) # ip rout 0.0.0.0 0.0.0.0 11.11.11.2
R2 (config) # ip rout 0.0.0.0 0.0.0.0 11.11.11.1
The above configurations are implemented for Vlan routers and switches. The rest of the work is to assign IP addresses to each PC!
This article is from the "network" blog, please be sure to keep this source http://adamcat.blog.51cto.com/6217526/1305230