Use the following procedure if you need to preserve the IP configuration that is associated with one network device and then move that configuration to another network device. You might perform this procedure as a prelude to removing a network card from the system or when changing a network cable connection.
For example purposes only, this procedure describes how to preserve the IP configuration that is associated with the net0 (e1000g0) device, then apply the configuration to the nge0 device.
The following example assumes that the IP configuration for e1000g0 is down for whatever reason and therefore the configuration needs to be moved to nge0:
# dladm show-phys LINK MEDIA STATE SPEED DUPLEX DEVICE net0 Ethernet down 0 unknown e1000g0 net1 Ethernet down 0 unknown e1000g1 net2 Ethernet up 1000 full nge0 net3 Ethernet down 0 unknown nge1
# ipadm disable-if interface
For example, you would disable the IP configuration on net0 as follows:
# ipadm disable-if net0
This step enables you to rename the datalink without having to recreate its IP configuration.
For example, you might rename the net0 datalink as follows:
# dladm rename-link net0 oldnet0
# dladm rename-link new-link primary-link
For example, you would reassign the net0 link name to the net2 datalink as follows:
# dladm rename-link net2 net0
# ipadm enable-if -t net0
When you perform a fresh installation, all of the datalinks on the system are automatically assigned generic names that use the naming convention, net0, net1, and netN, and so on, depending on the total number of network devices on a system. After the installation, you can assign different names to the datalinks. The following example shows how to change an IP address that was initially provided for an interface, which involves first removing the existing interface:
# ipadm delete-ip net0 # ipadm create-ip net0 # ipadm create-addr -T addrconf net0/new-add