Re: change the ip address without rebooting
On Sun, 12 Sep 1999, Robert Maynard Rhyu wrote:
> On Mon, 13 Sep 1999, Shao Zhang wrote:
>
> > How do I change the ip address of my machine without rebooting?
> >
> > I did an
> >
> > ifconfig eth0 xxx.xxx.xxx.xx netmask 255.255.255.0 broadcast
> > xxx.xxx.xxx.255
> >
> > But it does not seem to be enough. After the above command, I
> > cannot telnet to anywhere unless I do a reboot...
> >
> > Can someone please help me??
>
> You must take down the interface prior to assigning it a new IP address:
>
> Be sure to edit /etc/init.d/network and /etc/hosts to reflect your
> changes if you intend to keep your new IP address.
When did this become a requirement? I dynamically changed the address of
several boxes live. I just had
ifconfig eth0 <old address & parameters>
ifconfig eth0:1 <new address & parameters>
route blah
route blah:1
in operation and
ifconfig eth0 <new address & parameters>
ifconfig eth0:1 <old address & parameters>
route blah
route blah:1
in my /etc/init.d/network. I just ran /etc/init.d/network and it changed
fine.
Even wilder was the time I was coming in from a telnet session and ran
/etc/init.d/network from a remote computer. Not only did the address swap
successfully, I didn't even lose my telnet session!
Pete
--
Peter J. Templin, Jr., CCNA
Systems and Networks Administrator
On-Line Internet Services - URDirect.net
A division of Global On-Line Computers
2414 Babcock Rd. Suite 106 templin@urdirect.net
San Antonio, TX 78229 (210)692-9911
Reply to: