Router and three-layer switch experiment Demo--a gateway that acts as a two VLAN

Source: Internet
Author: User
Tags what interface


Router and three-layer switch experiment Demo--a gateway that acts as a two VLAN

--Hundred dishes



background : We know that routers have routing capabilities, so you know how to configure two gateways on a router interface (such as a two VLAN gateway)? Note that it is on one interface instead of two, and we sometimes use the three-layer switch as a router, so how do we configure the three-tier switch at this time? Let's illustrate with one-arm routing as an example.

I don't say much here, just to show you the operation on packet Tracer6.0.


Environment:Windows operating system, Packet Tracer 6.0


Experiment One: direct-connect routing

Single-arm routing differs from direct-attached routing, what's the difference? See below

This is a direct-connect Route :

650) this.width=650; "Src=" http://s2.51cto.com/wyfs02/M00/82/4A/wKioL1dQK_ Qztujoaaahvslwoq0454.png "title=" image 3.png "alt=" Wkiol1dqk_qztujoaaahvslwoq0454.png "/>

The following diagram is a single-arm route

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/82/4C/wKiom1dQIaSiZnx8AAAoN0TFzgs092.png "title=" Picture 4.png "alt=" Wkiom1dqiasiznx8aaaon0tfzgs092.png "/>

So the question is, how do I configure VLAN10 and Vlan20 two LAN gateways on the same interface of the router (f0/0 of the router in the diagram)? Considering that this blog post is for entry-level readers, the following first gives direct-attached configuration steps and commands, familiar friends can skip the past, directly look at the single-arm routing:

1, first download installs Packet Tracer 6.0 (or higher version, wordy, Packet Tracer is a simulation of Cisco is a Cisco device software, the configuration of the device and the real machine is the same as the way to prepare, open into:

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/82/4C/wKiom1dQLZGTYq0SAAEss6EBdAg082.png "title=" Picture 1.png "alt=" Wkiom1dqlzgtyq0saaess6ebdag082.png "/>

2. We need a router and two PCs:

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/82/4C/wKiom1dQLnihXmGjAAFZVN_bhZM930.png "title=" Picture 4.png "alt=" wkiom1dqlnihxmgjaafzvn_bhzm930.png "/> This step is very simple, if never contact packet tracer do not worry, The blogger in the diagram of the router and PC, as well as the type of connection needed to play an arrow number. say more, but if you want to learn more about equipment configuration or experiment, it is recommended that you should be familiar with a simulation software such as Packet Tracer (like Cisco GNS3, Huawei ENSP, etc.).

2, (1) Click on the PC0 on the left side of the configuration diagram:

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/82/4B/wKioL1dQMe2wjK3hAAAlvO580Xw124.png "title=" Picture 5.png "alt=" Wkiol1dqme2wjk3haaalvo580xw124.png "/>

(2) Open desktop

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/82/4B/wKioL1dQMnTRRFVaAACnFIxu1AA498.png "title=" Picture 6.png "alt=" Wkiol1dqmntrrfvaaacnfixu1aa498.png "/>

(3) Configure the IP address, mask, and gateway for the PC0:

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/82/4C/wKiom1dQMcuz42qiAACzxbqGtgE129.png "title=" Picture 7.png "alt=" Wkiom1dqmcuz42qiaaczxbqgtge129.png "/>

Here the IP address is: 192.168.10.1; The mask is 24 bits: 255.255.255.0; Gateway: 192.168.10.254 For example:

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/82/4B/wKioL1dQMyiQlbUUAADO657Fqdo983.png "title=" Picture 8.png "alt=" Wkiol1dqmyiqlbuuaado657fqdo983.png "/>

(4) The same way, configure the parameters of the PC1:

The IP address is: 192.168.20.1; mask 24 bits: 255.255.255.0; Gateway: 192.168.20.254:

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/82/4C/wKiom1dQMsGypi7fAADPT2X2qv8710.png "title=" Picture 9.png "alt=" Wkiom1dqmsgypi7faadpt2x2qv8710.png "/>

(5) Next Configure the router, click Open Router:

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/82/4B/wKioL1dQM9uTQKIBAAAfN5n5WFs336.png "style=" float: none; "title=" Image 10.png "alt=" Wkiol1dqm9utqkibaaafn5n5wfs336.png "/>

(6) Select command Line input:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/82/4C/wKiom1dQMtvBhs--AABFCN71en0861.png "style=" float: none; "title=" Image 11.png "alt=" Wkiom1dqmtvbhs--aabfcn71en0861.png "/>

If the command input interface shows whether to continue configuring the dialog, enter no (or N) to reject and enter:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/82/4B/wKioL1dQM9vgx-jmAABUAdPjMMc364.png "style=" float: none; "title=" Image 12.png "alt=" Wkiol1dqm9vgx-jmaabuadpjmmc364.png "/>

(7) Enter "Enable" to enter the privileged mode (the mode can view the information of the device); Enter "Configure Terminal" into the global mode (this mode can be configured to change the parameters of the device):

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/82/4C/wKiom1dQMtvQefq8AAAycpD5LHY593.png "style=" float: none; "title=" Image 13.png "alt=" Wkiom1dqmtvqefq8aaaycpd5lhy593.png "/>

(8) Enter the Fast Ethernet interface f0/0 (this depends on what interface you PC0 to the router), open the interface (Cisco default interface shutdown, to manually open) Configure the interface IP address (which is the gateway address we configured in PC0 above):

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/82/4B/wKioL1dQM9zh3ppDAABG0tMnrmA157.png "style=" float: none; "title=" Image 14.png "alt=" Wkiol1dqm9zh3ppdaabg0tmnrma157.png "/>

(9) Similarly, we enter the interface F0/1, configure the IP address (PC1 gateway address), enable the interface:

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/82/4C/wKiom1dQMtzymG0HAAA4oKrqtHU098.png "style=" float: none; "title=" Image 15.png "alt=" Wkiom1dqmtzymg0haaa4okrqthu098.png "/>

(10) At this time we can test the two different networks between the interoperability, if we can communicate with the direct link to the experiment is successful. First click to open PC0:

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/82/4C/wKiom1dQMtzS9KA6AAAmeL3FH30802.png "style=" float: none; "title=" Image 16.png "alt=" Wkiom1dqmtzs9ka6aaamel3fh30802.png "/>

(11) Open the command line input interface:

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/82/4B/wKioL1dQM92SEExvAAIC8F39Wxo790.png "style=" float: none; "title=" Image 17.png "alt=" Wkiol1dqm92seexvaaic8f39wxo790.png "/>

() Ping PC1 (192.168.20.1):

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/82/4C/wKiom1dQMt3g2CGFAABuAqd54bY248.png "style=" float: none; "title=" Image 18.png "alt=" Wkiom1dqmt3g2cgfaabuaqd54by248.png "/>

If the above shows the information, it means that PC0 and PC2 interoperability. The experiment was a perfect success. Sharp-eyed's small partner may have found the first ICMP request timeout! What is this for? Because at first PC0 do not know the physical address of PC2, so it will make ARP request, so it will cause the ICMP request time-out, so when we in the future experiment to add a mind, sometimes may be the first ping does not pass, but more ping Keats, but also "silly" I don't know why I thought there was something wrong and it was embarrassing.


If there is no problem with the direct-attached routing experiment, then the play comes, and the following is a quick look at one-arm routing experiment. But the blogger here can be divided into a step-by-step demonstration of only the main configuration of the explicit (looking at the explicit confused or do not know what the ghost of the small partners, it is recommended to do some more relevant configuration experiments, to learn more basic configuration commands)


Experiment 2 single-arm routing

2.1 Single-arm routing-router configuration

(1) According to the following parameters configuration is good:

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/82/52/wKioL1dREd7wz_ytAABEiGKcKKE943.png "title=" Picture 21.png "alt=" Wkiol1dred7wz_ytaabeigkckke943.png "/>

Configuration of the host Part I believe everyone is fine, below I give the switch and Router configuration command:

(2) Switch section:

Go to global configuration mode

Switch (config) #inter f0/1//Enter F0/1 interface

Switch (config-if) #switchport mode access//interface mode set to access

Switch (config-if) #swicthport access VLAN 10//interface access to VLAN10

Switch (config) #exit//exit

Switch (config) #inter F0/2//Enter F0/2 interface

Switch (config-if) #switchport mode access//interface mode set to access

Switch (config-if) #swicthport access VLAN 20//interface access to Vlan20

Switch (config) #exit//exit

(3) Router section

Go to global configuration mode:

Router (config) #inter f0/0//Enter f0/0 interface

Router (config-if) #no shutdown//enable interface


Router (config-if) #

%link-5-changed:interface fastethernet0/0, CHANGED state-to-up


%lineproto-5-updown:line protocol on Interface fastethernet0/0, changed


Router (config-if) #inter f0/0.10//Create Virtual Switch interface f0/0.10

Router (CONFIG-SUBIF) #

%link-5-changed:interface fastethernet0/0.10, CHANGED state-to-up


%lineproto-5-updown:line protocol on Interface fastethernet0/0.10, changed


Router (config-subif) #encapsulation dot1q 10//interface package is 10 (i.e. Vlan20)

Router (config-subif) #ip address 192.168.10.254 255.255.255.0//Configure addresses

Router (config-subif) #inter f0/0.20//Create Virtual interface f0/0.20

Router (CONFIG-SUBIF) #

%link-5-changed:interface fastethernet0/0.20, CHANGED state-to-up


%lineproto-5-updown:line protocol on Interface fastethernet0/0.20, changed


Router (config-subif) #encapsulation dot1q 20//interface package is 20 (i.e. Vlan20)

Router (config-subif) #ip address 192.168.20.254 255.255.255.0//Configure addresses

Router (CONFIG-SUBIF) #exit//End

Router (config) #

(4) test whether the network is normal (two PCs can communicate with each other):

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/82/54/wKioL1dRMIzwwcmqAAAe4SPNOlA245.png "title=" Picture 22.png "alt=" Wkiol1drmizwwcmqaaae4spnola245.png "/>

After testing, the network all normal. Experimental success!


2.2 Single-arm routing-three-layer switch configuration


(1) The same, according to the parameters given below to configure;650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/82/58/wKioL1dRjmaT9lRCAAAuJKmTddA810.png "title=" Picture 23.png "alt=" Wkiol1drjmat9lrcaaaujkmtdda810.png "/>

(2) Configuration commands for Layer two switches I give again here:

Go to global configuration mode:

Switch (config) #inter f0/1//Enter F0/1 interface

Switch (config-if) #switchport mode access//interface mode set to access

Switch (config-if) #switchport access VLAN 10//Interface Access VLAN10

% Access VLAN does not exist. Creating VLAN//vlan10 not present, automatically created VLAN10

Switch (CONFIG-IF) #exit//exit

Switch (config) #inter F0/2//Enter interface F0/2

Switch (config-if) #switchport mode access//interface mode set to access

Switch (config-if) #switchport access VLAN 20//interface Access VLAN 20

% Access VLAN does not exist. Creating VLAN//vlan20 not present, automatically created Vlan20

Switch (CONFIG-IF) #exit//exit

Switch (config) #inter F0/3//Enter interface F0/3

Switch (config-if) #switchport mode trunk//interface mode set to Trunk

Switch (config-if) #

%lineproto-5-updown:line protocol on Interface FASTETHERNET0/3, changed

%lineproto-5-updown:line protocol on Interface FASTETHERNET0/3, changed

Switch (config-if) #

(3) Configuration commands for layer three switches:

Switch (config) #inter F0/1//Enter interface F0/1

Switch (config-if) #switchport Trunk Encapsulation dot1q//trunk protocol encapsulated as dot1q

Switch (config-if) #switchport mode trunk//switch interface to trunk

Switch (CONFIG-IF) #exit//exit

Switch (config) #vlan 10//Create Vlan10

Switch (Config-vlan) #exit//exit

Switch (config) #vlan 20//Create Vlan20

Switch (Config-vlan) #exit//exit

Switch (config) #inter vlan 10//Enter VLAN10 interface

Switch (config-if) #

%link-5-changed:interface Vlan10, CHANGED state-to-up

%lineproto-5-updown:line protocol on Interface Vlan10, changed

Switch (config-if) #ip address 192.168.10.254 255.255.255.0//Configure VLAN10 addresses

Switch (CONFIG-IF) #exit//exit

Switch (config) #inter VLAN 20//Enter VLAN20 interface

Switch (config-if) #

%link-5-changed:interface Vlan20, CHANGED state-to-up

%lineproto-5-updown:line protocol on Interface Vlan20, changed

Switch (config-if) #ip address 192.168.20.254 255.255.255.0//Configure VLAN20 addresses

Switch (CONFIG-IF) #exit//exit

Switch (config) #ip routing//start the Routing function

Switch (config) #

(4) Detect whether the two PCs can communicate with each other properly (normal test results are as follows):

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/82/59/wKiom1dRkrOxe-ihAAAe4SPNOlA649.png "title=" Picture 22.png "alt=" Wkiom1drkroxe-ihaaae4spnola649.png "/>

Our experiments have also been perfectly implemented here. Really have to applaud for themselves!!


If not familiar with or first contact with the command to configure the device then the article content is more difficult, so I also said in the above, it is best to master A will use the simulation software, and then do a few simple network topology experiment, so whether it is the understanding of this article or future study will have great help. I am the Hundred dishes (Powersource), welcome each way the big God communicates with me! See you next time.

This article is from the "Hundred Dishes" blog, please be sure to keep this source http://powersource.blog.51cto.com/11364294/1785997

Router and three-layer switch experiment Demo--a gateway that acts as a two VLAN

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.