preload
Feb 07

Nice new command in Solaris 11 express and Solaris 11 is ipadm. The command is soon to replace good old ifconfig. Here is little cheat sheet for basic operations.

Use dladm to list info about physical interfaces:

# dladm show-phys
LINK              MEDIA                STATE      SPEED  DUPLEX    DEVICE
net0              Ethernet             up         100    full      bnx0
net4              Ethernet             down       0      unknown   ixgbe0

Notice that Oracle has changed link names to be netX by default and not after link name.

This is not the case if you upgraded from express to 11. You can rename the link name with dladm rename-link old-linkname new-linkname

To configure address to interface we first need to bring the interface up (plumb)

# ipadm create-ip net4
# dladm show-phys net4
LINK              MEDIA                STATE      SPEED  DUPLEX    DEVICE
net4              Ethernet             up         10000  full      ixgbe0

Configure address to newly created interface.

Static IP:


# ipadm create-addr -T static -a 10.0.0.1/24 net4/lan

DHCP:


# ipadm create-addr -T dhcp net4/lan

Change netmask:


# ipadm set-addrprop -p prefixlen=8 net4/lan

List active interfaces:

# ipadm show-if
IFNAME     CLASS    STATE    ACTIVE OVER
lo0        loopback ok       yes    --
net0       ip       ok       yes    --
net4       ip       ok       yes    --

Show current addresses:

# ipadm show-addr
ADDROBJ           TYPE     STATE        ADDR
lo0/v4            static   ok           127.0.0.1/8
net0/v4           static   ok           1.1.1.1/24
net4/lan          static   ok           10.0.0.1/24

Add default gateway, -p for persistance so it will be activated on reboot:

# route -p add default 1.1.1.254

Delete address:


# ipadm delete-addr net4/lan

Delete interface:


# ipadm delete-ip net4

Leave a Reply

You must be logged in to post a comment.