Routing between VLANs (iii)

Source: Internet
Author: User
Tags config cisco 2950
Ii. Four solutions for inter-VLAN routing:

2. Two solutions for inter-VLAN routing (Figure 1-3): Using a router with an Ethernet interface


Figure 1-3
This solution might have guessed that you need a router that supports relay links (trunks). It is necessary to encapsulate the ISL or 802.1q protocol on the trunk link of this router to activate the IP routing feature on this side of the router. This method of inter-VLAN routing is also referred to as "single-arm routing".
The disadvantage of one-arm routing is that it requires an additional "sacrifice" of a router, which is only used for routing between VLANs, and if we can use cheaper devices to solve this inter-VLAN routing problem, then not every network engineer will be willing to use one-arm routing. However, although the cost of such a solution is high, it is an effective solution.

Device-specific configuration and testing of the two-VLAN routing solution:
Cisco2621>
cisco2621>en
Cisco2621#conf T
Cisco2621 (config) # interface fastethernet0/0 (enter Router f0/0 interface)
Cisco2621 (config-if) #no IP address (f0/0 interface does not assign IP addresses)
Cisco2621 (config-if) #no shutdown (Open Interface f0/0)
Cisco2621 (config-if) #exit
Cisco2621 (config) #interface fastethernet 0/0.1 (Enter logical sub-interface f0/0.1)
Cisco2621 (config-subif) #encapsulation dot1q 1 (encapsulated dot1q on the subinterface, "1" in the directive means VLAN 1, i.e. the subinterface is routed for VLAN 1 traffic)
Cisco2621 (config-subif) #ip address 192.168.1.1 255.255.255.0 (assigning IP addresses to this subinterface, which will become the default gateway for VLAN 1 users)
Cisco2621 (config-subif) #exit
Cisco2621 (config) #interface fastethernet 0/0.2 (Enter logical sub-interface f0/0.2)
Cisco2621 (config-subif) #encapsulation dot1q 2 (encapsulated dot1q on the subinterface, "2" in the directive means VLAN 2, i.e. the subinterface is routed for VLAN 2 traffic)
Cisco2621 (config-subif) #ip add 192.168.2.1 255.255.255.0 (assigning IP addresses to this subinterface, which will become the default gateway for VLAN 2 users)
Cisco2621 (config-subif) #end
cisco2621#
-----------------------------------------------------------------------------------------------------
Cisco2950-a>
Cisco2950-a>enable (enter privileged mode)
Cisco2950-a#configure Terminal (enter configuration mode)
Cisco2950-a (config) #vlan 2 (Create a 2nd VLAN on the switch)
Cisco2950-a (Config-vlan) #name VLAN2 (name the VLAN you created is VLAN2)
Cisco2950-a (Config-vlan) #exit
Cisco2950-a (config) #interface gigabitethernet 1/1 (enter G1/1 interface)
Cisco2950-a (config-if) #switchport mode trunk (Enable relay link protocol on this interface)
Cisco2950-a (config-if) #switchport trunk Encapsulation dot1q (the DOT1Q protocol is encapsulated on this interface because the Cisco 2950 the router may have encapsulated the dot1q for you by default when you enable the Relay link protocol, so sometimes the instruction can be omitted)
Cisco2950-a (config-if) #exit
Cisco2950-a (config) #interface fastethernet 0/24
Cisco2950-a (config-if) #switchport mode trunk
Cisco2950-a (config-if) #switchport trunk Encapsulation dot1q
-----------------------------------------------------------------------------------------------------
Cisco2950-b >
Cisco2950-b >en (enter privileged mode)
Cisco2950-b #configure Terminal (enter configuration mode)
Cisco2950-b (config) #vlan 2 (Create a 2nd VLAN on the switch)
Cisco2950-b (Config-vlan) #name VLAN2 (name the VLAN you created is VLAN2)
Cisco2950-b (Config-vlan) #exit
Cisco2950-b (config) #interface gigabitethernet 1/1 (enter G1/1 interface)
Cisco2950-b (config-if) #switchport mode trunk (Enable relay link protocol on this interface)
Cisco2950-a (config-if) #switchport trunk Encapsulation dot1q (the DOT1Q protocol is encapsulated on this interface because the Cisco 2950 the router may have encapsulated the dot1q for you by default when you enable the Relay link protocol, so sometimes the instruction can be omitted)
Cisco2950-b (config-if) #exit
Cisco2950-b (config) #interface fastethernet 0/2 (enter F0/2 interface)
Cisco2950-b (config-if) #switchport mode access (Configure the F0/2 interface as an access port)
Cisco2950-b (config-if) #switchport Access VLAN 2 (dividing the F0/2 interface into VLAN 2, the workstation connected to that port becomes a member of VLAN 2)
-----------------------------------------------------------------------------------------------------
Workstation 2>tracert 192.168.1.2 (track the route to 192.168.1.2)
Pc>tracert 192.168.1.2
Tracing route to 192.168.1.2 over a maximum of hops:
1 ms, MS, Ms 192.168.2.1
2 ms 156 MS 192.168.1.2
Trace complete.
Workstation 2 Draws the following conclusions through TRACERT (route tracking) 192.168.1.2:
Workstation 2 to access the file server in VLAN 1, the path that is passed in turn is the F0/2 interface of the Cisco 2950-b, the G1/1 interface of the Cisco 2950-b (Trunk link), the 2950-a of the Cisco G1/ 1 interface (trunk link), F0/24 interface of the Cisco 2950-A, f0/0.1 interface of the Cisco 2621, f0/0.2 interface of the Cisco 2621, 2950-A interface of the Cisco F0/24 and 2950-a interface of the Cisco F0/1, Finally, the file server is reached to complete the routing between the VLANs.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.