04-Network Configuration

HomeSupportConfigure & DeployConfiguration ExamplesH3C Routers Easy and Effortless Routing Feature Configuration Examples-6W10004-Network Configuration
15-Router Basic Internet Access (Static IP) CLI-Based Configuration Examples

 

 

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.



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.

Figure 1 Network diagram

 

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.

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