• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 424
  • Last Modified:

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.
0
Techgoat
Asked:
Techgoat
  • 3
1 Solution
 
NopiusCommented:
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:
--[cut]--
myhostname plumb up
--[cut]

Open in new window

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

Open in new window

4) edit /etc/inet/netmasks:
--[cut]--
10.0.0.0 255.255.255.0 
--[cut]--

Open in new window

5) reboot

Regards,
Arty
0
 
NopiusCommented:
I guess 2) should be different:

2) edit /etc/hostname.e1000g0:
--[cut]--
inet myhostname netmask + broadcast + plumb up
--[cut]
0
 
NopiusCommented:
even without 'plumb' :-)
0
 
TechgoatAuthor Commented:
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now