On OpenSolaris 10 (Release 2010.05), I have used sys-unconfig to re IP a server but what if I merely need to change the IP address for an existing interface (call it e1000g0)?

Posted on 2011-03-06
Last Modified: 2012-05-11
Scenarion: I put up a guest instance of OpenSolris 10 on a vmware host, and it took a DHCP ip address during install. Then I wanted to reconfigure the interface, e1000g0, with a static IP.  I searched on the net and found many recommendations as to how to make the changes, but none persisted after a reboot.  

Tried this:
      svcadm disable physical:nwam
      svcadm enable physical:default

      Edit the following files in /etc -
      hostname.e1000g0 : to IP address - hostname.(Interface name) is the filename..
      /etc/hosts - add IP you want and short name + long name (fully qualified name)
      /etc/nodename - the primary name to use (for example in sendmail, etc.).
      /etc/defaultrouter - the IP of the default gateway
      /etc/netmasks - set the netmasks of your networks, i.e. generally for a /24,  if you don't know probably this..
      /etc/resolv.conf - list the name servers - for example:
      copy /etc/nsswitch.dns to /etc/nsswitch.conf - so dns is used
      Restart network to check:
      svcadm restart milestone/network

Then tried rebooting, and ifconfig -a reveals that the existing DHCP address remained in effect.

Next I followed a recommendation as follows:
       ifconfig e1000g0 down
       ifconfig e1000g0 netmask up

And again, the interface e1000g0 remained at DHCP; so then I tried unplumb for the interface and plumb it new, yet still the DHCP IP persisted after reboot.

Ultimately I used sys-unconfig to set a static IP, but I anticipate that there is a means of re-ip'ing an interface, but I have not yet discovered how! And since this a practice instance, I am willing to apply recommended strategies and report back with results. Thanks in advance.
Question by:Techgoat
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
LVL 27

Accepted Solution

Nopius earned 500 total points
ID: 35763293
Depending on 'network' instance you may have either 'default' or 'nwam' network configuration.
You can check it with:
bash-3.2# svcs network/physical
STATE          STIME    FMRI
disabled       23:00:16 svc:/network/physical:nwam
online         23:00:42 svc:/network/physical:default

Open in new window

I recommend you yo use 'default' instead of 'nwam' instance:
svcadm disable svc:/network/physical:nwam
svcadm enable svc:/network/physical:default

Open in new window

'default' instance runs this startup script: /lib/svc/method/net-physical

/lib/svc/method/net-physical itself configures physical interfaces (and interface flags).
it first checks for /etc/dhcp.e1000g0  file, and if found, it configures your interface by dhcp
then it checks /etc/hostname.e1000g0 for additional (ipmp ... parameters).

so I recommend you  to:
1) remove /etc/dhcp.e1000g0
2) edit /etc/hostname.e1000g0:
myhostname plumb up

Open in new window

3) edit /etc/inet/hostz:
--[cut]-- myhostname

Open in new window

4) edit /etc/inet/netmasks:

Open in new window

5) reboot

LVL 27

Expert Comment

ID: 35763294
I guess 2) should be different:

2) edit /etc/hostname.e1000g0:
inet myhostname netmask + broadcast + plumb up
LVL 27

Expert Comment

ID: 35763296
even without 'plumb' :-)

Author Closing Comment

ID: 35909638

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question