Link to home
Start Free TrialLog in
Avatar of Techgoat
TechgoatFlag for United States of America

asked on

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)?

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. 255.255.255.0 generally for a /24,  if you don't know probably this..
      /etc/resolv.conf - list the name servers - for example:
      nameserver 10.0.1.101
      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 10.0.1.122 netmask 255.255.255.0 up
       reboot

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.
ASKER CERTIFIED SOLUTION
Avatar of Arty K
Arty K
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I guess 2) should be different:

2) edit /etc/hostname.e1000g0:
--[cut]--
inet myhostname netmask + broadcast + plumb up
--[cut]
even without 'plumb' :-)
Avatar of Techgoat

ASKER

thanks