EdgeRouter - Configure Public Static IP Addresses


Overview


Readers will learn how to add static public IP address to an interface on the EdgeRouter.

NOTES & REQUIREMENTS:
Applicable to the latest EdgeOS firmware on all EdgeRouter models. Please see the Related Articles below for more information.
 
Device used in this article:

Introduction


There are different ways in which an Internet Service Provider (ISP) can provide you a public IP address, for example:

  • Static: The ISP provides you an IP range and requires you to manually add your own address(es) and gateway.
  • DHCP: The ISP provides you with an automatically assigned address through DHCP.
  • PPPoE: The ISP requires you to manually add your own PPPoE interface and authentication credentials.

If your service provider is providing you with a static IP address range, the information may be similar to:

Network Address: 203.0.113.0
Broadcast Address: 203.0.113.7
Subnet Mask: 255.255.255.248
Gateway Address: 203.0.113.6
DNS Servers: 192.0.2.1 - 192.0.2.2

The EdgeRouter requires IP addresses to be written in the CIDR format. This means that the ISP provided subnet mask (255.255.255.248) needs to be converted to a routing prefix. An easy way to convert from subnet masks to CIDR prefixes is to use an IPv4 subnet calculator.

Subnet Mask
CIDR prefix
255.255.255.255 /32
255.255.255.254 /31
255.255.255.252 /30
255.255.255.248 /29
Subnet Mask CIDR prefix
255.255.255.240 /28
255.255.255.224 /27
255.255.255.192 /26
255.255.255.128 /25

In this example the prefix will be /29 and the available IP addresses that we can add to the EdgeRouter are 203.0.113.1 - 203.0.113.5


Configure Static IP Addresses using the GUI


Back to Top

GUI: Access the Graphical User Interface (GUI).

1. Navigate to the Dashboard tab and assign the IP address(es) to the WAN interface.

Dashboard > Eth0 > Actions > Config

Address: Manually define IP address
IP: 203.0.113.1/29

+ Add IP

Address: Manually define IP address
IP: 203.0.113.2/29
IP: 203.0.113.3/29
IP: 203.0.113.4/29
IP: 203.0.113.5/2

interface_gui_config.png

2. Navigate to the System tab in the bottom-left of the GUI to add the default gateway and DNS servers.

System > Gateway

System gateway address: 203.0.113.6

System > Name Server

System name server: 192.0.2.1

+ Add New

System name server: 192.0.2.2

system_gui_config.png

NOTE: You can also configure the default gateway under the Routing tab.

Configure Static IP Addresses using the CLI


Back to Top

CLI: Access the command line interface (CLI). You can do this using the CLI button in the GUI or by using a program such as PuTTY.

1. Enter configuration mode.

configure

2.Assign the IP address(es) to the WAN interface.

set interfaces ethernet eth0 address 203.0.113.1/29
set interfaces ethernet eth0 address 203.0.113.2/29
set interfaces ethernet eth0 address 203.0.113.3/29
set interfaces ethernet eth0 address 203.0.113.4/29
set interfaces ethernet eth0 address 203.0.113.5/29

2. Add the default gateway address.

set system gateway-address 203.0.113.6
NOTE: You can also configure the default gateway using the set protocols static route 0.0.0.0/0 next-hop 203.0.113.6 command.

3. Add the DNS servers.

set system name-server 192.0.2.1
set system name-server 192.0.2.2

4. Commit the changes and save the configuration.

commit ; save

Related Articles


Back to Top

Intro to Networking - How to Establish a Connection Using SSH