04-Network Configuration

HomeSupportConfigure & DeployConfiguration ExamplesH3C Routers Easy and Effortless Routing Feature Configuration Examples-6W10004-Network Configuration
02-Basic Network Access (DHCP-Based IP Address Acquisition) Configuration Examples (CLI)

Basic Network Access (DHCP-Based IP Address Acquisition) Configuration Examples (CLI)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Copyright © 2024 New H3C Technologies Co., Ltd. All rights reserved.

No part of this manual may be reproduced or transmitted in any form or by any means without prior written consent of New H3C Technologies Co., Ltd.

Except for the trademarks of New H3C Technologies Co., Ltd., any trademarks that may be mentioned in this document are the property of their respective owners.

The information in this document is subject to change without notice.



Introduction

This document provides an example of configuring basic network access (DHCP-based IP address acquisition) through the CLI of a router.

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 DHCP and NAT.

Example: Configuring basic network access

Network configuration

As shown in Figure 1, the device acts as the egress router on the enterprise network and uses a single DHCP-enabled interface to provide the PC with access to the Internet.

Figure 1 Network diagram

 

Restrictions and guidelines

The address range in the address pool configured on the LAN interface cannot belong to the same network segment as the IP address of the WAN interface on the device.

Procedures

Configuring WAN interface settings

# Enable interface WAN1 (GE0/1) to use DHCP for IP address acquisition.

<Router> system-view

[Router] interface gigabitethernet 0/1

[Router-GigabitEthernet0/1] ip address dhcp-alloc

# Enable outbound dynamic NAT on interface WAN1 (GE0/1).

[Router-GigabitEthernet0/1] nat outbound

[Router-GigabitEthernet0/1] quit

Configuring LAN interface settings

# Configure interface GE0/2 as the gateway of the internal network.

[Router] interface gigabitethernet 0/2

[Router-GigabitEthernet0/2] ip address 192.168.10.1 24

[Router-GigabitEthernet0/2] quit

Configuring the device as an DHCP server

# Create DHCP address pool 1 and enter its view.

[Router] dhcp server ip-pool 1

# Specify network segment 192.168.10.0/24 for dynamic address allocation in DHCP address pool 1.

[Router-dhcp-pool-1] network 192.168.10.0 mask 255.255.255.0

# Specify gateway address 192.168.10.1 in DHCP address pool 1.

[Router-dhcp-pool-1] gateway-list 192.168.10.1

# Specify DNS server addresses 114.114.114.114 and 8.8.8.8 in DHCP address pool 1.

[Router-dhcp-pool-1] dns-list 114.114.114.114 8.8.8.8

# Set the lease duration to 10 days and 12 hours for IP addresses in DHCP address pool 1.

[Router-dhcp-pool-1] expired day 10 hour 12

[Router-dhcp-pool-1] quit

# Create DHCP address pool 1 and enter its view.

[Router] ip pool 1

# Specify network segment 192.168.10.0/24 for dynamic address allocation in DHCP address pool 1.

[Router-ip-pool-1] network 192.168.10.0 mask 255.255.255.0

# Specify gateway address 192.168.10.1 in DHCP address pool 1.

[Router-ip-pool-1] gateway-list 192.168.10.1

# Specify DNS server addresses 114.114.114.114 and 8.8.8.8 in DHCP address pool 1.

[Router-ip-pool-1] dns-list 114.114.114.114 8.8.8.8

# Set the lease duration to 10 days and 12 hours for IP addresses in DHCP address pool 1.

[Router-ip-pool-1] expired day 10 hour 12

[Router-ip-pool-1] quit

# Enable interface GE0/2 to operate as a DHCP server and assign IP address to DHCP clients in the internal network.

[Router] interface gigabitethernet 0/2

[Router-GigabitEthernet0/2] dhcp select server

[Router-GigabitEthernet0/2] quit

Verifying the configuration

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