Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Oct 2000 21:19:41 -1000 (HST)
From:      Vincent Poy <vince@oahu.WURLDLINK.NET>
To:        Erin <Kahn@deadbbs.com>
Cc:        questions@FreeBSD.ORG
Subject:   Re: Adding an IP alias without a reboot.
Message-ID:  <Pine.BSF.4.21.0010172112100.1344-100000@oahu.WURLDLINK.NET>
In-Reply-To: <004d01c03866$e3edb540$e815820a@sdccd.cc.ca.us>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 17 Oct 2000, Erin wrote:

	It's pretty easy, let's assume you have a primary ip of
123.123.123.2 and you wanted to add the alias 124.123.123.2,
All you have to do is:

ifconfig fxp0 inet 124.123.123.2 netmask 255.255.255.0 alias

	Replace the fxp0 with the ethernet card type you're using...  
For the DNS, all you have to do is change the /etc/resolv.conf file or
basically edit it.  As for the default router.  Do this in one line.

route delete default ; route add default newgatewayip

	And you can even either delete the primary IP or flip it around as
follows later.  Make sure everything is on one line separated by the ;'s:

ifconfig fxp0 inet 123.123.123.2 delete ; 
ifconfig fxp0 inet 124.123.123.2 delete ;
ifconfig fxp0 inet 124.123.123.2 netmask 255.255.255.0

The above will delete the original primary and replace it with the
alias.  Then there is the flipping around method as well.

ifconfig fxp0 inet 123.123.123.2 delete ;
ifconfig fxp0 inet 124.123.123.2 delete ;
ifconfig fxp0 inet 124.123.123.2 netmask 255.255.255.0 ;
ifconfig fxp0 inet 123.123.123.2 netmask 255.255.255.0 alias


Cheers,
Vince - vince@WURLDLINK.NET - Vice President             ________   __ ____ 
Unix Networking Operations - FreeBSD-Real Unix for Free / / / / |  / |[__  ]
WurldLink Corporation                                  / / / /  | /  | __] ]  
San Francisco - Honolulu - Hong Kong                  / / / / / |/ / | __] ]
HongKong Stars/Gravis UltraSound Mailing Lists Admin /_/_/_/_/|___/|_|[____]
Almighty1@IRC - oahu.DAL.NET Hawaii's DALnet IRC Network Server Admin


> I have a production machine whos IP is going to change. I have to add an
> aliased IP to it for a while from a completely different subnet then by the
> middle of next month have everything changed over (i.e. defaultrouter, dns
> servers, etc.). I'd like to do this with out rebooting the machine if
> possable.
> 
> The machine in question is a 3.3-RELEASE and is colocated with very limited
> access.
> 
> 
> Thanks,
> 
> 
> Erin
> 
> 
> mailto:kahn@deadbbs.com
> http://www.deadbbs.com
> http://www.fortenberry.net
> 
> 
> "Can i dial 1-255-255-255255 and make every phone in the world ring?"
> 
> -- Tanuki
> 
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
> 



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0010172112100.1344-100000>