network interface static
Configure a network interface to use a static IP configuration. You can use this command to configure a static IPv4 address or a static IPv6 address.
You must issue this command on each network interface that will be connected using a static IP configuration.
NOTE You cannot configure an interface that is a member of an active bond. You must first disable the bond. See network interface bonding
NOTE Running this command changes the interface state and causes the ctc service to restart (see Crypto Traffic Controller for QoS).
User Privileges
Users with the following privileges can perform this command:
>Admin
>Operator
Syntax
network interface static -device <netdevice> -ip <IP_address> -netmask <IP_or_prefixlength> [-gateway <IP_address>] [-force] [-ipv6]
Argument(s) | Shortcut | Description |
---|---|---|
-device <netdevice> | -d |
Specifies the network device you want to configure. Valid values: eth0, eth1, eth2, eth3 |
-force | -f | Force the action without prompting. |
-gateway <IP_address> | -g |
Specifies the address of the network gateway. >If you are configuring an IPv4 address, you must provide an IPv4 address for the gateway. > If you are configuring an IPv6 address, you must provide an IPv6 address for the gateway. |
-ip <IP_address> | -i |
Specifies the IP address you want to assign to the device. You can specify an IPv4 or IPv6 address. If you are configuring an IPv6 address, you must also include the -ipv6 flag in the command. When entering an IPv6 address, you can use full or shorthand syntax. For example, the following notations are equivalent: >2001:0db3:8ba3:0000:0000:8a5e:03f0:7384 >2001:db3:8ba3::8a5e:3f0:7384 |
-ipv6 | -ipv |
Specifies that the address specified using the -ip parameter is an IPv6 address. |
-netmask <IP_address> | -n |
Specifies the network mask for the interface. > If you are configuring an IPv4 address, you must specify the network mask in dotted-decimal format (for example, 255.255.255.0) > If you are configuring an IPv6 address, you must specify the prefix length (for example, 64). |
Example
IPv4 configuration
lunash:>network interface static -device eth0 -ip 192.20.11.78 -gateway 192.20.11.10 -netmask 255.255.255.0
NOTICE: The network connection for device eth0 will be restarted for new network settings to take effect.
If you are sure that you wish to restart the device connection, then type 'proceed', otherwise type 'quit'
> proceed
Proceeding...
Command Result : 0 (Success)
lunash:>network show
Hostname : sa7pw
Name Server(s) :
Search Domain(s) : <not set>
Interface settings and status
HW Address (eth0) : 00:15:B2:A9:B7:84
IP Address (eth0) : 192.20.11.78/24
Mask (eth0) : 255.255.255.0
Gateway (eth0) : 192.20.11.10
DNS (eth0) :
DNS Search (eth0) :
IP Protocol (eth0) : IPv4
Protocol (eth0) : Static
Auto Connect (eth0) : Yes
Activated (eth0) : Yes
Link detected (eth0) : Yes
Command Result : 0 (Success)
IPv6 configuration
lunash:>network interface static -device eth1 -ip 2001:0db3:8ba3:0000:0000:8a5e:03f0:7384 -netmask 64 -gateway 2001:0db3:a348:0000:0000:6b3a:0024:7336 -ipv6
NOTICE: The network connection for device eth1 will be restarted for new network settings to take effect.
If you are sure that you wish to restart the device connection, then type 'proceed', otherwise type 'quit'
> proceed
Proceeding...
Command Result : 0 (Success)
lunash:>network show
Hostname : sa7pw
Name Server(s) :
Search Domain(s) : <not set>
Interface settings and status
HW Address (eth1) : 00:15:B2:A9:B7:85
IP Address (eth1) : 2001:db3:8ba3::8a5e:3f0:7384/64
Mask (eth1) : 2001:db3:8ba3::/64
Gateway (eth1) : 2001:db3:a348::6b3a:24:7336
DNS (eth1) :
DNS Search (eth1) :
IP Protocol (eth1) : IPv6
Protocol (eth1) : Static
Auto Connect (eth1) : Yes
Activated (eth1) : Yes
Link detected (eth1) : Yes