- 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 |
---|---|---|
15-Router Basic Internet Access (Static IP) CLI-Based Configuration Examples | 56.89 KB |
Router Basic Internet Access (Static IP) CLI-Based Configuration Examples
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 Hangzhou 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 Internet access settings (static IP) for the router
Configuring the device as a DHCP server
Introduction
The following information provides an example of the CLI-based configuration for basic Internet access (static IP) on a router.
Prerequisites
Procedures and information in the document 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 Internet access settings (static IP) for the router
Network configuration
As shown in Figure 1, the device acts as the enterprise network's egress router, with the WAN port specified with static IP address 10.1.1.1/24. The gateway address for connection to the external network is 10.1.1.2. Configure the router for the user's PC to access the Internet through the router.
Restrictions and guidelines
The address range of the address pool specified on the LAN interface cannot be in the same subnet as the WAN interface IP address on the device.
Procedures
Configuring the WAN interface
# Configure a static IP address for the WAN 1 (GE0/1) port.
<Router> system-view
[Router] interface gigabitethernet 0/1
[Router-GigabitEthernet0/1] ip address 10.1.1.1 24
# Configure NAT to achieve dynamic address translation for outbound traffic.
[Router-GigabitEthernet0/1] nat outbound
[Router-GigabitEthernet0/1] quit
Configuring a default route
# Configure a default route with next-hop address as the gateway address assigned by the ISP.
[Router] ip route-static 0.0.0.0 0.0.0.0 10.1.1.2
Configuring the LAN interface
# Configure interface GE0/2 as the internal network gateway to connect to 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 a DHCP server
# Create DHCP address pool 1 and enter its view.
[Router] dhcp server ip-pool 1
# Configure the DHCP address pool to dynamically assign addresses in the 192.168.10.0/24 network segment.
[Router-dhcp-pool-1] network 192.168.10.0 mask 255.255.255.0
# Specify the gateway address as 192.168.10.1 for the DHCP address pool.
[Router-dhcp-pool-1] gateway-list 192.168.10.1
# Set the DNS server addresses to 114.114.114.114 and 8.8.8.8.
[Router-dhcp-pool-1] dns-list 114.114.114.114 8.8.8.8
# Specify the address lease as 10 days and 12 hours.
[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
# Configure the DHCP address pool to dynamically assign addresses in the 192.168.10.0/24 network segment.
[Router-ip-pool-1] network 192.168.10.0 mask 255.255.255.0
# Specify the gateway address as 192.168.10.1 for the DHCP address pool.
[Router-ip-pool-1] gateway-list 192.168.10.1
# Set the DNS server addresses to 114.114.114.114 and 8.8.8.8.
[Router-ip-pool-1] dns-list 114.114.114.114 8.8.8.8
# Specify the address lease as 10 days and 12 hours.
[Router-ip-pool-1] expired day 10 hour 12
[Router-ip-pool-1] quit
# Specify interface GE0/2 as a DHCP server to assign IP addresses to internal clients.
[Router] interface gigabitethernet 0/2
[Router-GigabitEthernet0/2] dhcp select server
[Router-GigabitEthernet0/2] quit
Verifying the configuration
Verify that the PC can access the Internet.