POUWIEL|COM

JeroenPouwiel

Oracle Solaris 11 Express: change from nwam DHCP to ipadm static IP

So, way back when I wrote this post, I thought I was done with it.

Seems the procedure described then, isn’t any good now. At least, come Hell or high water, I could not get a static IP and enjoy it…
Till this pdf crossed my digital path, and sure enough… I got a static IP which worked (skip to page 17: “Configuring Network Resources”).
Below the transcript:

solaris11():/root>ipadm create-if e1000g0

solaris11():/root>ipadm show-if e1000g0
IFNAME     STATE    CURRENT      PERSISTENT
e1000g0    down     bm--------46 -46

solaris11():/root>ifconfig e1000g0
e1000g0: flags=1000842 mtu 1500 index 2
	inet 0.0.0.0 netmask 0
	ether 8:0:27:79:ae:ec 

solaris11():/root>ipadm create-addr -T static -a 192.168.0.16/24 e1000g0/v4

solaris11():/root>ifconfig e1000g0
e1000g0: flags=1000843mtu 1500 index 2
	inet 192.168.0.16 netmask ffffff00 broadcast 214.120.0.255
	ether 8:0:27:79:ae:ec 

solaris11():/root>ipadm show-addr e1000g0/v4
ADDROBJ           TYPE     STATE        ADDR
e1000g0/v4        static   ok           192.168.0.16/24

solaris11():/root>ping 192.168.0.1
192.168.0.1 is alive

solaris11():/root>route -p add default 192.168.0.1
add net default: gateway 192.168.0.1
add persistent net default: gateway 192.168.0.1

solaris11():/home/oracle>svcadm enable svc:/milestone/network:default

solaris11():/home/oracle>svcadm enable ssh

solaris11():/home/oracle>cat /etc/resolv.conf
nameserver 64.71.134.52
nameserver 64.71.134.53

solaris11():/home/oracle>netstat -r

Routing Table: IPv4
  Destination           Gateway           Flags  Ref     Use     Interface
-------------------- -------------------- ----- ----- ---------- ---------
default              192.168.0.1          UG        2         22
localhost            localhost            UH        2         76 lo0
192.168.0.0          solaris11            U         4        110 e1000g0

Routing Table: IPv6
  Destination/Mask            Gateway                   Flags Ref   Use    If
--------------------------- --------------------------- ----- --- ------- -----
localhost                   localhost                   UH      2       4 lo0
fe80::/10                   fa80::af0:23ff:fe19:acec    U       2       0 e1000g0

solaris11():/home/oracle>cat /etc/nodename
solaris11

solaris11():/home/oracle>cat /etc/inet/hosts
# CDDL HEADER START
#
# ...
#
127.0.0.1       localhost
::1     localhost
192.168.0.16    solaris11       loghost

solaris11():/home/oracle>cat /etc/defaultrouter
192.168.0.1

solaris11():/home/oracle>cat /etc/inet/netmasks
#
# CDDL HEADER START
#
# ...
#
192.168.0.0     255.255.255.0
solaris11():/home/oracle>cat /etc/nsswitch.conf|grep netmasks
netmasks:   files

solaris11():/home/oracle>cat /etc/nsswitch.conf|grep hosts
# "hosts:" and "services:" in this file are used only if the
hosts:      files

Now, you probably won’t need to create the network interface e1000g0, but my zealous efforts somehow led to the disappearance of that particular interface.

Comments are closed.

Categories