Networking in Solaris 11, How to configure IP address in Solaris 11 (Part – 2)

Solaris 11 came with new command ipadm to deal with network interfaces. ifconfig is still thr but this new command is having easy SYNTAX and changes made are persistent across the reboot. So you don’t have to mess up with configuration files now.

How to check the current active interfaces on server.

root@solaris11:~# ipadm show-if
IFNAME CLASS STATE ACTIVE OVER
lo0 loopback ok yes —
net0 ip ok yes —

How to check the IP address assigned to server.

root@solaris11:~# ipadm show-addr
ADDROBJ TYPE STATE ADDR
lo0/v4 static ok 127.0.0.1/8
net0/v4 static ok 192.168.120.160/24
lo0/v6 static ok ::1/128
net0/v6 addrconf ok fe80::20c:29ff:fe7f:ba49/10

Another way to do the same thing.

root@solaris11:~# ipadm
NAME CLASS/TYPE STATE UNDER ADDR
lo0 loopback ok — —
lo0/v4 static ok — 127.0.0.1/8
lo0/v6 static ok — ::1/128
net0 ip ok — —
net0/v4 static ok — 192.168.120.160/24
net0/v6 addrconf ok — fe80::20c:29ff:fe7f:ba49/10

Now currently I am having lot of network interfaces on server but it was showing me only one in output of ipadm show-if because all other are not up currently.

root@solaris11:~# dladm show-link
LINK CLASS MTU STATE OVER
net0 phys 1500 up —
net1 phys 1500 unknown —
net2 phys 1500 unknown —
net3 phys 1500 unknown —
net4 phys 1500 unknown —
net5 phys 1500 unknown —
net6 phys 1500 unknown —

Create IP on inactive interface.

root@solaris11:~# ipadm create-ip net1
root@solaris11:~# ipadm create-addr -T static -a 192.168.120.161 net1/v4

You can see the newly created IP in output of ipadm command.

How to deal with property of interface. Linkprop can be managed by dladm and other properties can be controlled by ipadm.

root@solaris11:~# dladm show-linkprop net1
LINK PROPERTY PERM VALUE DEFAULT POSSIBLE
net1 speed r- 1000 1000 —
net1 autopush rw — — —
net1 zone rw — — —
net1 duplex r- full full

root@solaris11:~# dladm show-linkprop -p mac-address
LINK PROPERTY PERM VALUE DEFAULT POSSIBLE
net0 mac-address rw 0:c:29:7f:ba:49 0:c:29:7f:ba:49 —
net1 mac-address rw 0:c:29:7f:ba:53 0:c:29:7f:ba:53 —
net2 mac-address rw 0:c:29:7f:ba:5d 0:c:29:7f:ba:5d —
net3 mac-address rw 0:c:29:7f:ba:67 0:c:29:7f:ba:67 —
net4 mac-address rw 0:c:29:7f:ba:71 0:c:29:7f:ba:71 —
net5 mac-address rw 0:c:29:7f:ba:7b 0:c:29:7f:ba:7b —
net6 mac-address rw 0:c:29:7f:ba:85 0:c:29:7f:ba:85 —

If we want to enable the forwarding on one or on call Ethernet we can follow the below procedure as per requirement.

root@solaris11:~# ipadm show-ifprop -p forwarding net0
IFNAME PROPERTY PROTO PERM CURRENT PERSISTENT DEFAULT POSSIBLE
net0 forwarding ipv4 rw off — off on,off
net0 forwarding ipv6 rw off — off on,off

root@solaris11:~# ipadm set-ifprop -p forwarding=on -m ipv4 net0

root@solaris11:~# ipadm show-ifprop -p forwarding net0
IFNAME PROPERTY PROTO PERM CURRENT PERSISTENT DEFAULT POSSIBLE
net0 forwarding ipv4 rw on on off on,off
net0 forwarding ipv6 rw off — off on,o

To enable for all interfaces

root@solaris11:~# ipadm show-prop -p forwarding ipv4
PROTO PROPERTY PERM CURRENT PERSISTENT DEFAULT POSSIBLE
ipv4 forwarding rw off — off on,o

All available options with ipadm

root@solaris11:~# ipadm help
The following subcommands are supported:
Address : create-addr delete-addr disable-addr
down-addr enable-addr refresh-addr
reset-addrprop set-addrprop show-addr
show-addrprop up-addr
Interface : disable-if enable-if reset-ifprop
set-ifprop show-if show-ifprop
IP interface : create-ip delete-ip
IPMP interface : add-ipmp create-ipmp delete-ipmp
remove-ipmp
Protocol property : reset-prop set-prop show-prop
VNI interface : create-vni delete-vni
For more info, run: ipadm help <subcommand>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s