Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
multiple IP addresses on one server
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
zambizzi
Guru
Guru


Joined: 28 Aug 2004
Posts: 581
Location: Boise Idaho

PostPosted: Fri Sep 03, 2004 10:05 pm    Post subject: multiple IP addresses on one server Reply with quote

I have a dedicated gentoo web/email/ftp server and the hosting provider has given me 3 IP addresses to use on my machine.

How do I add them to my machine?

One of them is working and active but the other two are "dead" as they haven't been "added" to my server.

Would I add them in the /etc/conf.d/net file? For example, would this work?:

Code:

iface_eth0="204.225.92.134 204.225.92.137 204.225.92.138 broadcast 204.225.92.128 netmask 255.255.255.0"


...by just putting them all in line like that?

I'm asking first because I'd hate to reboot and lose contact w/ my box. Then I have to pay tech support to fix my n00b evil ways.

Thanks!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54801
Location: 56N 3W

PostPosted: Fri Sep 03, 2004 10:15 pm    Post subject: Reply with quote

zambizzi,

You add the inactive ones as alias es with ifconfig
the form of the command is
Code:
ifconfig eth0:1 ....
ifconfig eth0:2 .....

You need the right odds and ends in your kernel.

They work like seperate interfaces, so you need to update your routing table too.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
zambizzi
Guru
Guru


Joined: 28 Aug 2004
Posts: 581
Location: Boise Idaho

PostPosted: Fri Sep 03, 2004 10:32 pm    Post subject: well...uhhhmmmm.... Reply with quote

NeddySeagoon wrote:
zambizzi,

You add the inactive ones as alias es with ifconfig
the form of the command is
Code:
ifconfig eth0:1 ....
ifconfig eth0:2 .....

You need the right odds and ends in your kernel.

They work like seperate interfaces, so you need to update your routing table too.


Care to elaborate? Routing table? What exactly is required in the kernel so I know if I'm missing it or not?

I'm *very* new to Gentoo and though not a n00b w/ linux, have never delved this deep into the system.

Thanks!
Back to top
View user's profile Send private message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1500

PostPosted: Sat Sep 04, 2004 2:49 am    Post subject: Reply with quote

This is how I do it..

This is a snip from /etc/conf.d/net. xxx.xxx.xxx.xxx will need to be replaced with your IPs.

Code:
# primary ip value for eth0
iface_eth0="xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx"

# set up aliases... seperated by spaces
alias_eth0="xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx "
netmask_eth0="255.255.255.255 255.255.255.255"
gateway="eth0/xxx.xxx.xxx"


when you do a ifconfig, you should see interfaces listed like this:

Code:
eth0
eth0:1
eth0:2
lo


All you need to do see the change is do /etc/init.d/net.eth0 restart

hanji
Back to top
View user's profile Send private message
zambizzi
Guru
Guru


Joined: 28 Aug 2004
Posts: 581
Location: Boise Idaho

PostPosted: Sat Sep 04, 2004 6:28 am    Post subject: grrrrrrrreat! Reply with quote

hanj wrote:
This is how I do it..

This is a snip from /etc/conf.d/net. xxx.xxx.xxx.xxx will need to be replaced with your IPs.

Code:
# primary ip value for eth0
iface_eth0="xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx"

# set up aliases... seperated by spaces
alias_eth0="xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx "
netmask_eth0="255.255.255.255 255.255.255.255"
gateway="eth0/xxx.xxx.xxx"


when you do a ifconfig, you should see interfaces listed like this:

Code:
eth0
eth0:1
eth0:2
lo


All you need to do see the change is do /etc/init.d/net.eth0 restart

hanji


Again, thank you, you've been a HUGE help!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum