Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 03-03-2003, 06:06 PM   #1 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
multiple ips in debian

can anyone show me how i can configure multiple static ips in debian?
sde is offline   Reply With Quote
Old 03-03-2003, 07:08 PM   #2 (permalink)
Slimy
Registered User
 
Join Date: Mar 2003
Posts: 3
Slimy is on a distinguished road
Re: multiple ips in debian

Quote:
Originally posted by sde
can anyone show me how i can configure multiple static ips in debian?
Do you mean multiple static IPs on the same interface (IP aliasing)?
Slimy is offline   Reply With Quote
Old 03-03-2003, 07:12 PM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
yes .. i have a range of 6 ips i need to configure to 1 nic
sde is offline   Reply With Quote
Old 03-03-2003, 07:27 PM   #4 (permalink)
Slimy
Registered User
 
Join Date: Mar 2003
Posts: 3
Slimy is on a distinguished road
If you are using a 2.2 kernel, you need to enable IP aliasing. In a 2.4 kernel this is automatically supported.

If I have a static IP of 192.168.42.1 on eth1, and I wish to create an alias address for that adapter, I do this at the command line:
ifconfig eth1:1 192.168.42.72

A quick check using ifconfig (with no parameters) should show an entry for a device called eth1:1, with address 192.168.42.72.

If it worked, you're ready to add it to /etc/network/interfaces, where ifup and ifdown can get to it.

Code:
auto eth1
iface eth1 inet static
     address 192.168.42.1
     netmask 255.255.255.0
     broadcast 192.168.42.255
     network 192.168.42.0

auto eth1:1
iface eth1:1 inet static
     address 192.168.42.72
     netmask 255.255.255.0
     broadcast 192.168.42.255
     network 192.168.42.0
Slimy is offline   Reply With Quote
Old 03-03-2003, 07:30 PM   #5 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
thanks a lot! i screwed up my network config so i have to wait for the data center to get in there .. but at least now i know the right way.

thankyou
sde is offline   Reply With Quote
Old 03-03-2003, 07:34 PM   #6 (permalink)
Slimy
Registered User
 
Join Date: Mar 2003
Posts: 3
Slimy is on a distinguished road
Also note the format of the alias:
<interface>:<alias> (for example eth2:23)

<alias> can be any number between 0 and 255,
but some operating systems (like Solaris) won't allow <alias> to be 0.
Linux likes eth2:0 just fine, though.
Slimy is offline   Reply With Quote
Old 03-03-2003, 07:43 PM   #7 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
excellent to know .. i'll probably just use eth0:0 to eth0:5 for my ips.
thanks!
sde is offline   Reply With Quote
Old 04-01-2003, 06:23 PM   #8 (permalink)
acidreign
Registered User
 
Join Date: Apr 2003
Location: Brisbane, Australia
Posts: 5
acidreign is on a distinguished road
Virtual Hosting

Something which may, or may not be relavant, if you are doing virtual hosting, you can often present a different service to different clients depending on the name that they have looked up.

ie.. beta3.no-ip.com resolves to the same ip as
wmealing.no-ip.ocm

Depending on what name they look up, the virtual service handler can look at them differentlty.

Multiple IP's may be the easiest way in this situation, but its worth learning. Check out each of the daemons if they support virtual hosts. Most of the more common ones do.
acidreign is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
colors in cl / debian sde Linux / BSD / OS X 2 09-28-2004 06:29 PM
debian / apache / http authentication sde Linux / BSD / OS X 4 08-02-2004 02:55 PM
Debian v3.0 release bdl Linux / BSD / OS X 11 08-09-2002 10:25 PM
debian install report sde Linux / BSD / OS X 4 05-09-2002 04:56 PM
Debian ISO sde Linux / BSD / OS X 12 05-07-2002 07:17 PM


All times are GMT -8. The time now is 02:14 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting