Single-arm Routing and DHCP

Source: Internet
Author: User

The previous experiment shows that cross-VLAN is not able to communicate even if the same network segment.
So how to solve this method, this is the focus of this experiment.

Experimental topology

Requirements
Use DHCP technology to get your PC to automatically obtain IP addresses and ensure that you can communicate with each other.

Solutions
You can see that this topology and the previous experiment is almost a small difference, is to add a router, but this router is the focus.
The switch configuration is the same as the previous experimental configuration
SW2 switch configuration Trunk on E1/1 interface
SW2 (config) #interface Ethernet 1/1
SW2 (config-if) #switchport trunk Encapsulation dot1q
SW2 (config-if) #switchport mode trunk
How does a router recognize the forwarding of two VLANs with only one line?
This involves the concept of sub-interfaces, which we can "change" into two lines and allow him to identify two different VLANs.
Configuration of the switch there's been an experiment.
Here is the configuration of the router
R1 (config) #interface Ethernet 1/1
R1 (config-if) #no shutdown
R1 (config-if) #ex
R1 (config) #int e1/1.10
R1 (config-subif) # encapsulation dot1q 10
R1 (config-subif) #ip address 192.168.1.254 255.255.255.0
R1 (config) #int e1/1.20
R1 (config-subif) # encapsulation dot1q 20
R1 (config-subif) #ip address 192.168.2.254 255.255.255.0

R1 (config) #ip DHCP pool 10
R1 (dhcp-config) #default-router 192.168.1.254
R1 (dhcp-config) #network 192.168.1.0 255.255.255.0
R1 (config) #ip DHCP pool 20
R1 (dhcp-config) #default-router 192.168.2.254
R1 (dhcp-config) #network 192.168.2.0 255.255.255.0
Verify

You can see that the IP of PC1 is automatically secured and can ping through PC2

And Ping PC4 is also available.

Experiment completed

Single-arm Routing and DHCP

Related Article

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.