Software >> OS >> Unix >> Solaris >> 11 >> Networking >> What are the commands to configure, add, modify and delete IP address

You use the ipadm command to configure IP interfaces and addresses in Oracle Solaris 11. For example, a static IPv4 interface is configured as follows:

# ipadm create-ip net0
# ipadm create-addr -T static -a local=10.9.8.7/24 net0
net0/v4

You can use the –T option to specify three address types: static, dhcp, and addrconf (for auto-configured IPv6 addresses). In this example, the system is configured with a static IPv4 address. You can use the same syntax to specify a static IPv6 address. However, static IPv6 addresses require that a link-local IPv6 address be configured prior to creating any static IPv6 addresses. This configuration is accomplished by creating an IPv6 addrconf address before creating the static IPv6 address:

# ipadm create-ip net0
# ipadm create-addr -T addrconf net0 net0/v6
# ipadm create-addr -T static -a local=ec0:a:99:18:209:3dff:fe00:4b8c/64 net0 net0/v6a

Configure an interface with DHCP as follows:

# ipadm create-ip net0

for IPv4
# ipadm create-addr -T dhcp net0

for IPv6
# ipadm create-addr -T dhcp net0 net0/v6a

 

Use the addrconf argument with the –T option to specify an automatically generated IPv6 address:

# ipadm create-ip net0
# ipadm create-addr -T addrconf net0
net0/v6

If you wanted to change the IP address that was provided for the net0 interface in the previous example, you would need to first remove the interface and then re-add it, as shown in the following example:

# ipadm delete-addr net0/v4
# ipadm create-addr -T static -a local=10.7.8.9/24 net0
net0/v4