01-Downlink Layer 2 Switch Configuration Examples

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

Introduction

This document describes the configuration method for connecting a layer 2 switch to a router for internet access.

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.

Version used

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

Example configuration

Networking requirements

As shown in Figure 1, Router is connected to Switch 1 and Switch 2, with Host A and Host B connected to Switch 1 and Switch 2 respectively. The current requirement is:

·     Host A acquires an IP address from the VLAN 10 network segment, while Host B acquires an IP address from the VLAN 20 network segment.

·     The gateways for VLAN 10 and VLAN 20 are located on the Router, which also serves as the DHCP server to allocate IP addresses to the Host.

Figure 1 Router Multi-Network Segment Internet Configuration Group Diagram

 

Data planning

Table 1 Subnet Planning

Subnet

Detailed data planning

VLAN 10

·     Network segment: 192.168.10.0/24

·     Gateway Location: Router

·     Gateway interface IP address: 192.168.10.1/24

VLAN 20

·     Network segment: 192.168.20.0/24

·     Gateway Location: Router

·     Gateway IP address: 192.168.20.1/24.

For more information about VLAN 1, the interconnect address between the Router and Switch.

·     Network Segment: 192.168.1.0/24

·     Router interface IP address: 192.168.1.1/24.

·     Switch 1 interface IP address: 192.168.1.2/24

·     Switch 2 interface IP address: 192.168.1.3/24

 

Table 2 Add the interface to the VLAN plan.

Device

Add the interface to the VLAN configuration.

Router

·     The GE4 interface connects to Switch 1 as a Trunk type, with a PVID of 1, allowing VLAN 1 and VLAN 10 to pass.

·     The GE5 interface connects to Switch 2 as a Trunk type, with PVID set to 1, allowing VLAN 1 and VLAN 20 to pass.

Switch 1

·     The GE1/0/1 interface connects to the Router as a Trunk type, with a PVID of 1, allowing VLAN 1 and VLAN 10 to pass.

·     Interface GE1/0/2 connects to Host A, configured as Access type, allowing VLAN 10 to pass.

Switch 2

·     The GE1/0/1 interface connects to the Router as a Trunk type, with a PVID of 1, allowing VLAN 1 and VLAN 20 to pass.

·     Interface GE1/0/2 connects to Host B, set as Access type, allowing VLAN 20 to pass through.

 

Analysis

·     Log in to the Router Web management interface through a browser, and configure the Switch via the Console port.

·     Subnet the network on the Router and Switch according to the plan, and configure a DHCP server on the Router to allocate IP addresses to endpoints.

Restrictions and guidelines

·     In this example, the default IP address for VLAN 1 on the Router is 192.168.0.1/23. You need to change the default IP addresses for VLAN 1 on both the Router and the Switch as required.

·     After changing the default IP address of VLAN 1 on the router, use the new IP address to log in to the Web management (Mgmt) interface.

Set up preparation.

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

·     Validate that the PC has terminal software installed and is connected to the Switch's Console port via a serial line. For more information about the connection, refer to the relevant documentation. Launch the terminal software and configure the necessary parameters to connect to the Switch's back end interface.

Procedure Configuration

Configure the Router.

1.     Change the default IP address' for VLAN 1.

To meet the requirements, change the IP address of VLAN 1 to 192.168.1.1/24. The configuration procedure is as follows:

In the device's Web management (Mgmt) interface, select Network Settings > LAN Configuration to access the LAN configuration page.

Click the edit icon in the operation column of the Vlan-interface1 row to access the LAN configuration modification page.

In the interface IP address configuration item, change the IP address to 192.168.1.1.

In the subnet mask configuration item, change the subnet mask to 255.255.255.0.

Deselect the Enable DHCP Service radio box to turn off the DHCP service.

Keep other settings as the default configuration and click OK to save the configuration.

Figure 2 To change LAN settings, go to the Control Panel.

 

2.     Create VLAN 10.

Create VLAN 10, configure the interface's IP address, and enable DHCP service on the interface.

In the device's Web Mgmt interface, select Network Settings > LAN Configuration to access the LAN configuration page.

Click the Add button to access the Add LAN Configuration page.

In the LAN interface type configuration item, select VLAN interface.

Enter 10 in the VLAN ID configuration item.

In the interface IP address configuration item, enter 192.168.10.1.

Enter 255.255.255.0 in the subnet mask configuration item field.

Select the radio box in front of Enable DHCP Service to activate the DHCP service on the interface.

Keep other configuration items at their default settings and click Save to save the configuration.

Figure 3 Create VLAN 10.

 

3.     Create VLAN 20. For more information about VLAN configuration, refer to the relevant section.

Divide VLAN 20 and configure the interface's IPaddress. Enable the interface's DHCP service.

In the device's Web management interface navigation bar, select Network Settings > LAN Configuration to access the LAN configuration page.

Click Add to access the LAN configuration page.

In the LAN interface type configuration item, select VLAN interface.

Enter 20 in the VLAN ID configuration item.

Enter 192.168.20.1 in the interface IP address configuration item.

Enter 255.255.255.0 in the subnet mask configuration item (CI) field.

Select the radio box in front of Enable DHCP Service to activate the DHCP service on the interface.

Keep other configuration items at their default settings and click Save to save the configuration.

Figure 4 Divide VLAN 20.

 

4.     Configure the GE4 interface.

Configure the GE4 interface to pass both VLAN 1 and VLAN 10.

In the device's Web management interface, select Network Settings > LAN Configuration to access the LAN configuration page.

a.     Click the VLAN  Allocation  tab to access the VLAN allocation configuration page.

Click the edit icon corresponding to the GE4 interface to access the detailed port configuration page.

Click on VLAN 10 in the Available VLANs box to add it to the Selected VLANs box.

Keep other configuration items at their default settings and click Save to save the configuration.

5.     Configure the GE5 interface.

Configure the GE5 interface to pass both VLAN 1 and VLAN 20.

In the device's Web management (Mgmt) interface, select Network Settings > LAN Configuration to access the LAN configuration page.

a.     Click the VLAN Allocation  tab to access the VLAN allocation  configuration page.

Click the edit icon corresponding to the GE5 interface to access the detailed port configuration page.

Click on VLAN 20 in the Available VLANs box to add it to the Selected VLANs box.

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

Configuring Switch 1
Configuring an VLAN

1.     Configure the IP address for VLAN 1 and assign VLAN 10.

<L2 switch 1> system-view

[L2 switch 1] interface vlan 1

[L2 switch 1-interface1] ip address 192.168.1.2 24

[L2 switch 1-interface1] 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 1 and VLAN 10 to pass.

[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 1 10

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

3.     Configure the GE1/0/2 interface.

Configure the GE1/0/2 interface as Access type and allow VLAN 10 to pass.

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

1.     Set up a VLAN.

Configure the IP address for VLAN 1 and assign VLAN 20.

<L2 switch 2> system-view

[L2 switch 2] interface vlan 1

[L2 switch 2-interface1] ip address 192.168.1.3 24

[L2 switch 2-interface1] quit

[L2 switch 2] VLAN 20

[L2 switch 2-VLAN20] quit

2.     Configure the GE1/0/1 interface.

Configure the GE1/0/1 interface as Trunk and allow VLAN 1 and VLAN 20 to pass

[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.

Configure the GE1/0/2 interface as Access type and allow VLAN 20 to pass.

[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

Verifying the configuration

Host A can obtain an IP address from the VLAN 10 network segment, while Host B can obtain an IP address from the VLAN 20 network segment, confirming the configuration is successful.

 

  • 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
新华三官网