02-Downlink Layer 3 Switch Configuration Examples

HomeSupportConfigure & DeployConfiguration ExamplesH3C MSR Routers Commonly Used Feature Configuration Examples(Web)-R6749-6W10102-Downlink Layer 3 Switch Configuration Examples
01-Downlink Layer 3 Switch Configuration Examples

Introduction

The following information provides an example of connecting the router to a Layer 3 switch.

Prerequisites

This document is not restricted to specific software or hardware versions. Procedures and information in the examples might be slightly different depending on the software or hardware version of the device.

The configuration examples were created and verified in a lab environment, and all the devices were started with the factory default configuration. When you are working on a live network, make sure you understand the potential impact of every command on your network.

The following information is provided based on the assumption that you have basic knowledge of VLAN and static routing.

Software version used

This configuration example was created and verified on MSR830-10HI Release 6749P21.

Configuration example

Network configuration

As shown in Figure 1, connect the router to a Layer 3 switch which is connected to Layer 2 switch 1 and Layer 2 switch 2. Connect host A and host B to Layer 2 switch 1 and Layer 2 switch 2, respectively. Configure the network to meet the following requirements:

·     Host A obtains an IP address from VLAN 10, and host B obtains an IP address from VLAN 20.

·     Gateways for VLAN 10 and VLAN 20 are located on the Layer 3 switch, which also acts as the DHCP server to allocate IP addresses to hosts.

·     Host A and host B can access the Internet.

Figure 1 Network diagram

 

Data plan

Table 1 Network planning

Network

Configuration

VLAN 10

·     Network: 192.168.10.0/24

·     Gateway location: Layer 3 switch

·     Gateway interface IP address: 192.168.10.1/24

VLAN 20

·     Network: 192.168.20.0/24

·     Gateway location: Layer 3 switch

·     Gateway interface IP address: 192.168.20.1/24

VLAN 100 (interconnect and management VLAN for devices)

·     Network: 172.16.10.0/24

·     Interconnect interface IP address on the router: 172.16.10.1/24.

·     Interconnect interface IP address on the Layer 3 switch: 172.16.10.2/24

·     Interconnect interface IP address on Layer 2 switch 1: 172.16.10.3/24

·     Interconnect interface IP address on Layer 2 switch 2: 172.16.10.4/24

 

Table 2 VLAN planning for interfaces

Device

VLAN planning for interfaces

Router

·     Connect GE1 to the Internet using DHCP.

·     Connect GE2 to the Layer 3 switch and configure its IP address as 172.16.10.2/24.

Layer 3 switch

·     Connect GE1/0/1 to the router, configure it as an access port, and assign it to VLAN100.

·     Connect GE1/0/2 to Layer 2 switch 1, configure it as a trunk port, set the PVID to 100, and assign it to VLAN100 and VLAN 10.

·     Connect GE1/0/3 to Layer 2 switch 2, configure it as a trunk port, set the PVID to 100, and assign it to VLAN100 and VLAN 20.

Layer 2 switch 1

·     Connect GE1/0/1 to the Layer 3 switch, configure it as a trunk port, set the PVID to 100, and assign it to VLAN100 and VLAN 10.

·     Connect GE1/0/2 to host A, configure it as an access port, and assign it to VLAN 10.

Layer 2 switch 2

·     Connect GE1/0/1 to the Layer 3 switch, configure it as a trunk port, set the PVID to 100, and assign it to VLAN100 and VLAN 20.

·     Connect GE1/0/2 to host B, configure it as an access port, and assign it to VLAN 20.

 

Analysis

·     Log in to the router management Web page through a browser and connect the console port to the switch.

·     Configure VLANs on Layer 2 and Layer 3 switches, and configure a DHCP server on the Layer 3 switch to automatically allocate IP addresses to hosts.

·     Configure the router to connect to the Internet and configure return routes to make sure traffic from the Internet can reach the internal networks and arrives at the hosts.

Prerequisites

·     Connect the PC to the router's LAN port with cables and configure a static IP address 192.168.0.X/23 on the PC. Then, open a browser and enter the router's management IP address https://192.168.0.1 to access the Web page.

·     Ensure that serial port terminal software is installed on the PC, and connect the PC to the console ports of the switches with serial console cables. Launch the terminal software and configure the parameters to access the backend interfaces of switches.

Procedures

Configuring the router

1.     Connect GE1 to the Internet:

# In this example, the external network interface mode of the router is single-WAN, and the WAN interface connection mode is DHCP. Perform the following tasks:

a.     Log in to the router management Web page. Navigate to Network > WAN Settings.

b.     Click the Scene tab and select Single-WAN scenario. Select WAN1 (GE1) in the Line1 field.

c.     Click Apply to complete the configuration.

Figure 2 Selecting WAN access scenario

 

 

a.     Click the WAN Settings tab.

b.     Click the Edit icon in the Actions column for WAN1(GE1).

c.     In the NAT field, enable NAT.

d.     Use the default settings for the other parameters, and click Apply.

Figure 3 Editing WAN settings

 

2.     Configure GE2:

# Configure the IP address and subnet mask for GE2 as planned.

a.     From the navigation pane, select Network > LAN Settings.

b.     Click Add.

c.     In the LAN interface type field, select GE interface.

d.     Select GE2.

e.     In the Interface IP address field, enter 172.16.10.1.

f.     In the Subnet Mask field, enter 255.255.255.0.

g.     Use the default settings for the other parameters, and click Apply.

Figure 4 Configuring GE2

 

3.     Configure static routes:

# Configure static routes to destination networks 192.168.10.1/24 and 192.168.20.1/24.

a.     From the navigation pane, select Advanced Settings > Static Routing.

b.     Click Add.

c.     In the Destination IP address field, enter 192.168.10.1.

d.     In the Mask length field, enter 24.

e.     In the Next hop field, unselect the Output interface option and enter 172.16.10.2 as the next hop IP address.

f.     Use the default settings for the other parameters, and click Apply.

Figure 5 Configuring a static route

 

g.     Click Add.

h.     In the Destination IP address field, enter 192.168.20.1.

i.     In the Mask length field, enter 24.

j.     In the Next hop field, unselect the Output interface option and enter 172.16.10.2 as the next hop IP address.

k.     Use the default settings for the other parameters, and click Apply.

Figure 6 Configuring a static route

 

Configuring the Layer 3 switch

1.     Configure VLAN:

# Create VLAN 10, VLAN 20, and VLAN 100, and configure their interface IP addresses.

<L3 Switch> system-view

[L3 Switch] vlan 100

[L3 Switch-VLAN100] quit

[L3 Switch] interface vlan 100

[L3 Switch-Vlan-interface100] ip address 172.16.10.2 24

[L3 Switch-Vlan-interface100] quit

[L3 Switch] VLAN 10

[L3 Switch-VLAN10] quit

[L3 Switch] interface vlan 10

[L3 Switch-Vlan-interface10] ip address 192.168.10.1 24

[L3 Switch-Vlan-interface10] quit

[L3 Switch] VLAN 20

[L3 Switch-VLAN20] quit

[L3 Switch] interface vlan 20

[L3 Switch-Vlan-interface20] ip address 192.168.20.1 24

[L3 Switch-Vlan-interface20] quit

2.     Configure the DHCP server:

# Enable DHCP.

[L3 Switch] dhcp enable

# Configure DHCP address pool 1. In the address pool, specify the gateway IP address as 192.168.10.1, the subnet for dynamic allocation as 192.168.10.0/24, and the DNS server address as 192.168.10.1.

[L3 Switch] dhcp server ip-pool 1

[L3 Switch-dhcp-pool-1] network 192.168.10.0 mask 255.255.255.0

[L3 Switch-dhcp-pool-1] gateway-list 192.168.10.1

[L3 Switch-dhcp-pool-1] dns-list 192.168.10.1

[L3 Switch-dhcp-pool-1] quit

# Configure DHCP address pool 2. In the address pool, specify the gateway IP address as 192.168.20.1, the subnet for dynamic allocation as 192.168.20.0/24, and the DNS server address as 192.168.20.1.

[L3 Switch] dhcp server ip-pool 2

[L3 Switch-dhcp-pool-2] network 192.168.20.0 mask 255.255.255.0

[L3 Switch-dhcp-pool-2] gateway-list 192.168.20.1

[L3 Switch-dhcp-pool-2] dns-list 192.168.20.1

[L3 Switch-dhcp-pool-2] quit

3.     Configure GE1/0/1:

# Configure GE1/0/1 as an access port and assign it to VLAN 100.

[L3 Switch] interface gigabitethernet 1/0/1

[L3 Switch-GigabitEthernet1/0/1] port link-type access

[L3 Switch-GigabitEthernet1/0/1] port access vlan 100

[L3 Switch-GigabitEthernet1/0/1] quit

4.     Configure GE1/0/2:

# Configure GE1/0/2 as a trunk port and assign it to VLAN 100 and VLAN 10.

[L3 Switch] interface gigabitethernet 1/0/2

[L3 Switch-GigabitEthernet1/0/2] port link-type trunk

[L3 Switch-GigabitEthernet1/0/2] port trunk permit VLAN 100 10

[L3 Switch-GigabitEthernet1/0/2] quit

5.     Configure GE1/0/3:

# Configure GE1/0/3 as a trunk port and assign it to VLAN 100 and VLAN 20.

[L3 Switch] interface gigabitethernet 1/0/3

[L3 Switch-GigabitEthernet1/0/3] port link-type trunk

[L3 Switch-GigabitEthernet1/0/3] port trunk permit VLAN 100 20

[L3 Switch-GigabitEthernet1/0/3] quit

6.     Configure a static route:

# Configure a static route to direct traffic accessing the Internet from the hosts to the router.

[L3 Switch] ip route-static 0.0.0.0 0 172.16.10.1

Configuring Layer 2 switch 1

1.     Configure VLAN:

# Create VLAN 100 and VLAN 10.

<L2 Switch 1> system-view

[L2 Switch 1] vlan 100

[L2 Switch 1-VLAN100] quit

[L2 Switch 1] interface vlan 100

[L2 Switch 1-Vlan-interface100] ip address 172.16.10.3 24

[L2 Switch 1-Vlan-interface100] quit

[L2 Switch 1] VLAN 10

[L2 Switch 1-VLAN10] quit

2.     Configure GE1/0/1:

# Configure GE1/0/1 as a trunk port and assign it to VLAN 100 and VLAN 10.

[L2 Switch 1] interface gigabitethernet 1/0/1

[L2 Switch 1-GigabitEthernet1/0/1] port link-type trunk

[L2 Switch 1-GigabitEthernet1/0/1] port trunk permit VLAN 100 10

[L2 Switch 1-GigabitEthernet1/0/1] quit

3.     Configure GE1/0/2:

# Configure GE1/0/2 as an access port and assign it to VLAN 10.

[L2 Switch 1] interface gigabitethernet 1/0/2

[L2 Switch 1-GigabitEthernet1/0/2] port link-type access

[L2 Switch 1-GigabitEthernet1/0/2] port access vlan 10

[L2 Switch 1-GigabitEthernet1/0/2] quit

[L2 Switch 1]

Configuring Layer 2 switch 2

1.     Configure VLAN:

# Create VLAN 100 and VLAN 10.

<L2 Switch 2> system-view

[L2 Switch 2] vlan 100

[L2 Switch 2-VLAN100] quit

[L2 Switch 2] interface vlan 100

[L2 Switch 2-Vlan-interface100] ip address 172.16.10.4 24

[L2 Switch 2-Vlan-interface100] quit

[L2 Switch 2] VLAN 20

[L2 Switch 2-VLAN20] quit

2.     Configure GE1/0/1:

# Configure GE1/0/1 as a trunk port and assign it to VLAN 100 and VLAN 20.

[L2 Switch 2] interface gigabitethernet 1/0/1

[L2 Switch 2-GigabitEthernet1/0/1] port link-type trunk

[L2 Switch 2-GigabitEthernet1/0/1] port trunk permit VLAN 1 20

[L2 Switch 2-GigabitEthernet1/0/1] quit

3.     Configure GE1/0/2:

# Configure GE1/0/2 as an access port and assign it to VLAN 20.

[L2 Switch 2] interface gigabitethernet 1/0/2

[L2 Switch 2-GigabitEthernet1/0/2] port link-type access

[L2 Switch 2-GigabitEthernet1/0/2] port access vlan 20

[L2 Switch 2-GigabitEthernet1/0/2] quit

[L2 Switch 2]

Verifying the configuration

Verify that host A can obtain an IP address from VLAN 10, host B can obtain an IP address from VLAN 20, and both hosts can access the Internet.

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become A Partner
  • Partner Policy & Program
  • Global Learning
  • Partner Sales Resources
  • Partner Business Management
  • Service Business
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网