02-Downlink Layer 3 Switch Configuration Examples

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

Introduction

This document details the configuration method for connecting a layer 3 switch to a router.

Prerequisites

This document is not strictly aligned with specific software or hardware versions. If discrepancies arise during use, refer to the actual conditions of the equipment for guidance. For more information about the product's actual situation, consult the device itself.

This document details configurations performed and verified in a lab environment, with all device parameters set to default factory settings. If you have already configured your device, ensure there are no conflicts with your existing settings and the examples provided below to guarantee the desired outcome.

This document assumes you are already familiar with VLAN and static routing features. For more information about these topics, refer to the respective detailed guides.

Version used

This configuration example was set up and validated on the MSR830-10HI router, version Release 6749L04.

Configuration examples

Network requirements

As depicted in Figure 1, a router is connected to an L3 Switch, which, in turn, is connected to L2 Switch 1 and L2 Switch 2. Host A and Host B are connected to L2 Switch 1 and L2 Switch 2, respectively. The requirement is as follows:

·     Host A obtains an IP address from VLAN 10, while Host B receives one from VLAN 20.

·     Gateways for VLAN 10 and VLAN 20 are located on the L3 Switch, which also serves as the DHCP server, assigning IP addresses to hosts.

·     Host A and Host B can connect to the internet.

Figure 1 Multi-segment Networking Configuration Diagram for Router Internet Access

 

Data planning

Table 1 Subnet planning

subnet

Detailed data planning

VLAN 10

·     Network segment: 192.168.10.0/24

·     Gateway Location: L3 Switch

·     Gateway interface IP address: 192.168.10.1/24

VLAN 20

·     Network segment: 192.168.20.0/24

·     Gateway Location: L3 Switch

·     Gateway interface IP address: 192.168.20.1/24

VLAN 100 (the interconnection and management VLAN for devices)

·     Network segment: 172.16.10.0/24

·     The interconnection interface IP address of the Router is 172.16.10.1/24.

·     The L3 switch's interconnection interface IP address is 172.16.10.2/24.

·     L2 Switch 1's interconnection interface IP is 172.16.10.3/24

·     L2 Switch 2's interconnection interface IP is 172.16.10.4/24

 

Table 2 Integrate the interface into VLAN planning.

Device

Interface Added to VLAN Planning

Router

·     The GE1 interface connects to the Internet using DHCP as the connection method.

·     The GE2 interface connects to the L3 switch with the IP address 172.16.10.2/24.

L3 Switch

·     The GE1/0/1 interface connects to the router as an Access type, permitting VLAN 100 to pass through.

·     The GE1/0/2 interface connects to L2 Switch 1 as a Trunk type, with a PVID of 100, allowing VLAN 100 and VLAN 10 traffic.

·     The GE1/0/3 interface connects to L2 Switch 2 as a Trunk type, with a PVID of 100, allowing VLAN 100 and VLAN 20 traffic.

L2 Switch 1

·     The GE1/0/1 interface connects to an L3 switch as a Trunk type, with a PVID of 100, allowing VLAN 100 and VLAN 10 to pass through.

·     The GE1/0/2 interface connects to Host A as an Access type and permits VLAN 10 traffic.

L2 Switch 2

·     The GE1/0/1 interface connects to an L3 switch as a Trunk type, with a PVID of 100, allowing VLAN 100 and VLAN 20 to pass through.

·     Connect the GE1/0/2 interface to Host B, set it as an Access type, and allow VLAN 20 to pass through.

 

Configuration approach

·     Log in to the router's web management interface using a browser, and configure the switch through the Console port.

·     Subnet on both L2 and L3 switches, and configure a DHCP server on the L3 switch to automatically assign IP addresses to end devices.

·     Configure the router to connect to the Internet, and set up the return route to allow Internet traffic to reach the internal network and terminal devices.

Configuration preparation

·     Connect the PC to the Router's LAN port using an Ethernet cable, set a static IP address on the PC to 192.168.0.X/23, then open a browser and enter the router's management IP address (https://192.168.0.1) to access the Web management interface.

·     Ensure the PC has terminal software installed and is connected to the Switch's Console port via a serial cable. Launch the terminal software and configure the parameters to access the Switch's backend interface.

Procedures

Configuring the Router

1.     Configure the GE1 interface to connect to the Internet.

In this example, the router's external interface is set to single WAN mode, with the WAN interface connection mode as DHCP. The configuration steps are as follows:

Select Network Settings > WAN Configuration from the device's Web management interface navigation bar to enter the WAN configuration page.

Under the Scenario Definition tab, choose the single WAN scenario and select Line 1 as WAN1 (GE1).

Click Apply to activate the configuration.

Figure 2 Defining the Scenario

 

d.     Click the WAN Configuration tab to enter the WAN configuration page.

Click the edit icon in the operation column for WAN1 (GE1) to modify the WAN configuration.

Enable the NAT Address Translation setting.

Keep all other settings at their default configuration and click OK to save the configuration.

Figure 3 Editing WAN Settings

 

2.     Configure the GE2 interface.

Set the IP address and subnet mask for the GE2 interface as required.

Select Network Settings > LAN Configuration from the device's Web management interface navigation bar to access the LAN configuration page.

Click Add to enter the page for adding a new LAN configuration.

Select GE interface for the LAN Interface Type setting.

Select GE2 for the Please Select GE Interface setting.

Enter 172.16.10.1 for the Interface IP Address setting.

Input 255.255.255.0 for the Subnet Mask setting.

Keep all other settings at their default, and click OK  to save the configuration.

Figure 4 Configuring the GE2 interface

 

 

3.     Configure static routes

Configure static routes to the destination subnets 192.168.10.0/24 and 192.168.20.0/24.

Select Advanced Options > Static Route from the device's Web management interface navigation bar to access the static route configuration page.

Click Add to enter the Add IPv4 Static Route configuration page.

Enter 192.168.10.0 for the Destination IP Address setting.

In the Mask Length configuration field, enter 24.

Uncheck the radio box before Outgoing Interface and enter the next-hop IP address 172.16.10.2 for the Next Hop setting.

Keep all other settings at their default, and click OK to save the configuration.

Figure 5 Configuring static routes

 

Click Add to enter the Add IPv4 Static Route configuration page.

Enter 192.168.20.0 for the Destination IP Address setting.

In the Mask Length configuration field, enter 24.

Uncheck the radio box before Outgoing Interface and enter the next-hop IP address 192.168.1.3 for the Next Hop setting.

Keep all other settings at their default, and click OK to save the configuration.

Figure 6 Configuring static routes

 

Configuring L3 Switch

1.     Configure VLAN

Divide into VLAN 10, VLAN 20, and VLAN 100 and configure their VLAN 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 DHCP server

Enable the DHCP Server function.

[L3 Switch] dhcp enable

Configure DHCP address pool 1 to allocate the address range 192.168.10.0/24 to clients, with the DNS server address set to the gateway address (configure the DNS server address for wireless clients according to actual network planning), and the gateway 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 to allocate the address range 192.168.20.0/24 to clients, with the DNS server address set to the gateway address (configure the DNS server address for wireless clients according to actual network planning), and the gateway 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 the GE1/0/1 interface.

Set the GE1/0/1 interface type to Access and allow VLAN 1 through.

[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 the GE1/0/2 interface.

Set the GE1/0/2 interface type to Trunk and allow VLAN 100 and VLAN 10 through.

[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 the GE1/0/3 interface.

Set the GE1/0/3 interface type to Trunk and allow VLAN 100 and VLAN 20 through.

[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 static routes

Configure a static route to direct terminal internet traffic towards the router.

[L3 Switch] ip route-static 0.0.0.0 0 172.16.10.1

Configuring L2 Switch 1

1.     Configure VLAN

Divide into 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 the GE1/0/1 interface.

Set the GE1/0/1 interface type to Trunk and allow VLAN 100 and VLAN 10 through.

[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 the GE1/0/2 interface.

Set the GE1/0/2 interface type to Access and allow VLAN 10 through.

[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 L2 Switch 2

1.     Configure VLAN

Divide into 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 the GE1/0/1 interface.

Set the GE1/0/1 interface type to Trunk and allow VLAN 100 and VLAN 20 through.

[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 the GE1/0/2 interface.

Set the GE1/0/2 interface type to Access and allow VLAN 20 through.

[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

Host A obtains an IP address from the VLAN 10 segment, and Host B from the VLAN 20 segment, both able to access the internet, confirming successful configuration.

  • 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 Resources
  • Partner Business Management
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网