- Table of Contents
-
- 04-Network Configuration
- 01-Access Public and Dedicated Networks Through Multiple WAN Interfaces (CLI)
- 02-Basic Network Access (DHCP-Based IP Address Acquisition) Configuration Examples (CLI)
- 03-ER G3 Routers PPPoE Configuration Examples (Web)
- 04-ER G3 Routers Basic Network Access (DHCP-Based IP Address Acquisition) (Web)
- 05-ER G3 Routers Basic Internet Access (Static IP) Web-Based Configuration Examples
- 06-MER Routers Basic Network Access (DHCP-Based IP Address Acquisition) (Web)
- 07-MER Routers Primary and Backup Network Accesses Through Multiple WAN Interfaces (Web)
- 08-MER Routers PPPoE Configuration Examples (Web)
- 09-MER Routers Access Public and Dedicated Networks Through Multiple WAN Interfaces (Web)
- 10-MER Routers Basic Internet Access (Static IP) Web-Based Configuration Examples
- 11-MSR Routers Basic Network Access (DHCP-Based IP Address Acquisition) (Web)
- 12-MSR Routers Basic Internet Access (Static IP) Web-Based Configuration Examples
- 13-MSR Routers Access Public and Dedicated Networks Through Multiple WAN Interfaces (Web)
- 14-MSR Routers PPPoE Configuration Examples (CLI)
- 15-Router Basic Internet Access (Static IP) CLI-Based Configuration Examples
- Related Documents
-
Title | Size | Download |
---|---|---|
02-Basic Network Access (DHCP-Based IP Address Acquisition) Configuration Examples (CLI) | 56.25 KB |
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.
Contents
Example: Configuring basic network access
Configuring WAN interface settings
Configuring LAN interface settings
Configuring the device as an DHCP server
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.
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.