[Summary] ifconfig & adding an IP to a live system

From: Chris Hoogendyk <hoogendyk_at_bio.umass.edu>
Date: Mon Feb 13 2006 - 15:43:50 EST
Thanks to Webpro, Darren Dunham, Jason LeDuc, Nathan Bardsley, Andrew
Hall, Jerry Kemp, Aaron Lineberger, Tom Crummey, Brooke King, Iain
Miller, Jason Gove, Christopher Wianecki, Suresh Rajagopalan, Steven C.
Liu, Ric Anderson, Yiannis Kanellopoulos, Simon Yuan, and Karl Vogel.

Consensus was ifconfig on live system should work. One person mentioned
the need to restart any daemons that might be listening or that should
listen on the new IP. In my case that would be Apache. However, this
could have been the source of confusion that lead to my question in the
first place. Obviously, if Apache is going to be reconfigured to listen
on this new IP as well as the previously existing IPs, then it needs to
be restarted with new conf files to tell it so. Some other programs
might not be as explicit or as well behaved in terms of their listening,
and could possibly get confused. That would be very software specific.
For example, I see nothing in our samba conf file to specify the
interface (though I see it in the samba book). Since we have a pile of
third party software doing network services, the decision from the boss
was to reboot in the wee hours.

I would welcome comments and discussion on that decision and the
reasoning behind it, and I will post a second summary if I get
sufficient traffic.

Virtually everyone followed the lines of Karl Vogel's reply:

   I've done this in the past on an E450 running Solaris 8.  
   Let's say your setup looks like this:

     interface name:  hme0:8
     interface IP:    123.45.67.8,  hostname "newhost"
     broadcast IP:    123.45.67.255
     netmask:         255.255.255.0

   The commands would be:

     # echo '123.45.67.8 newhost' >> /etc/hosts
     # echo newhost > /etc/hostname.hme0:8
     # ifconfig hme0:8 plumb
     # ifconfig hme0:8 inet 123.45.67.8 netmask 0xffffff00 \
           broadcast 123.45.67.255
     # ifconfig hme0:8 up

   -- 
   Karl Vogel                  I don't speak for the USAF or my company
   vogelke at pobox dot com               http://www.pobox.com/~vogelke


Some people mentioning interspersed `ifconfig -a`'s to see what it looks
like before/after each command.

One person said I didn't need the plumb, because the physical interface
was already plumbed.

Two others said that, with Solaris 9, I needed "addif", as in: `ifconfig
hme0 addif 123.45.67.8/24 up` -- which does the same as above in briefer
form all in one command -- however, I had already set up the things that
addif does automatically.

One person mentioned using `netstat -rn` at the end to verify routing
and to add static routes if necessary.

In reading through the man page, the section on logical interfaces gives
examples indicating that you can use either the plumb or the addif on a
logical interface, assuming you have already plumbed the physical
interface. What plumb does on a logical interface is analagous but not
identical to what it does on the physical interface (since some of the
"plumbing" is already done). So, the posting by Karl stands as correct,
although, with defaults, the second ifconfig could be abbreviated to:

     # ifconfig hme0:8 123.45.67.8/24


And, of course, once this is done, you have to check all your
applications and services, reconfiguring them and restarting them if
necessary to catch the new interface.



---------------

Chris Hoogendyk

-
   O__  ---- Systems Administrator
  c/ /'_ --- Biology & Geology Departments
 (*) \(*) -- 140 Morrill Science Center
~~~~~~~~~~ - University of Massachusetts, Amherst 

<hoogendyk@bio.umass.edu>

--------------- 




-------- Original Message --------
Subject: 	ifconfig & adding an IP to a live system
Date: 	Thu, 09 Feb 2006 14:31:54 -0500
From: 	Chris Hoogendyk <hoogendyk@bio.umass.edu>
To: 	Sun Managers List <sunmanagers@sunmanagers.org>



I have a critical server that I need to add an IP to. There is some
concern that simply doing the ifconfig on the live server might not do
it and might break existing stuff that is running.

This server is an E250 with Solaris 9 running a complex sendmail setup,
a web site with php, mysql, ssl, and several virtual hosts, samba and
netatalk, with file shares and print services going through those. It
currently has hme0, hme0:1 through hme0:7, with both internal and
external subnets.

Now I need to add hme0:8 with an IP for a professional organization we
are hosting that needs ssl virtual hosting in apache. I've set up the
changes in httpd.conf, ssl.conf, /etc/hostname.hme0:8, /etc/hosts, and
/etc/mail/local-host-names, and I'm confident that if I reboot it will
all come up. However, we cannot reboot this server unless one of us
comes in in the wee hours, and then I know that the server may take as
long as 15 minutes to boot because we have a lot of legacy drives
hanging on it that take a while to negotiate speeds (waiting for
timeouts) to get running.

If I wanted to do it right now, live, theoretically I could:

# ifconfig hme0:8 up

and it would start working. or I might need to fill out that command
with the IP & netmask.

However, there are concerns that this might fail and break things in the
process (memories of past attempts). The other virtual interfaces need
to continue working, and the running services need to continue
interacting through them with our users. Apache would need to be
restarted to read its conf files and begin listening to the IP on this
new virtual interface.

In order to do this live, is there anything else I would need to do
(other than the single ifconfig command)? Any kind of routing to
straighten out? (I have /etc/notrouter). Anything special to avoid
hitting the existing interfaces?

TIA


---------------

Chris Hoogendyk

-
   O__  ---- Systems Administrator
  c/ /'_ --- Biology & Geology Departments
 (*) \(*) -- 140 Morrill Science Center
~~~~~~~~~~ - University of Massachusetts, Amherst 

<hoogendyk@bio.umass.edu>

--------------- 
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Mon Feb 13 15:44:30 2006

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:55 EST