set ip address

Use this command to set the IP address, subnet mask and default gateway for a non-routing IP interface.

Syntax

set ip address ip_address [mask ip_mask] [gateway ip_gateway] [interface interface-name]

Parameters

ip_address Specifies the IPv4 or IPv6 address for a non-routing IP interface.
mask ip_mask (Optional) Sets the system‘s subnet mask.
gateway ip_gateway (Optional) Sets the IPv4 or IPv6 address of the system‘s default gateway (next-hop device).
interface interface-name (Optional) Sets the IP interface for this system.

Defaults

  • If not specified, ip-mask will be set to the natural mask of the ip-address and ip-gateway will be set to the ip-address.
  • If not specified, the first IP interface configured on a system becomes the default IP interface.

Mode

All command modes.

Usage

In a multiple IP interface configuration the explicit setting of the interface is required. The specifying of the interface creates the interface if it does not already exist.

Example

This example shows how to set the system IP address to 10.1.10.1 with a mask of 255.255.128.0 and a default gateway of 10.1.0.1:

System(rw)->set ip address 10.1.10.1 interface vlan.0.5 mask 255.255.128.0 gateway 10.1.10.1

This example shows how to set the system IPv6 address to 2001:11ac:dcaa::/48 and a default gateway of 2001:11ac:dcaa::5 on interface VLAN 50:

System(rw)->set ip address 2001:11ac:dcaa::/48 v6_gateway 2001:11ac:dcaa::5  interface vlan.0.50