View previous topic :: View next topic |
Author |
Message |
zambizzi Guru
Joined: 28 Aug 2004 Posts: 581 Location: Boise Idaho
|
Posted: Fri Sep 03, 2004 10:05 pm Post subject: multiple IP addresses on one server |
|
|
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 |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54801 Location: 56N 3W
|
Posted: Fri Sep 03, 2004 10:15 pm Post subject: |
|
|
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 |
|
|
zambizzi Guru
Joined: 28 Aug 2004 Posts: 581 Location: Boise Idaho
|
Posted: Fri Sep 03, 2004 10:32 pm Post subject: well...uhhhmmmm.... |
|
|
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 |
|
|
hanj Veteran
Joined: 19 Aug 2003 Posts: 1500
|
Posted: Sat Sep 04, 2004 2:49 am Post subject: |
|
|
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 |
|
|
zambizzi Guru
Joined: 28 Aug 2004 Posts: 581 Location: Boise Idaho
|
Posted: Sat Sep 04, 2004 6:28 am Post subject: grrrrrrrreat! |
|
|
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 |
|
|
|