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
Medium Priority
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:
      nameserver 208.67.xxx.xxx
      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
  • 3
LVL 27

Accepted Solution

Nopius earned 2000 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

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Question has a verified solution.

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

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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses
Course of the Month4 days, 1 hour left to enroll

600 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