View previous topic :: View next topic |
Author |
Message |
wizy Tux's lil' helper
Joined: 26 May 2002 Posts: 133
|
Posted: Thu May 30, 2002 7:05 pm Post subject: multiple ip's on the same computer |
|
|
I have 8 ips that I would like to put on 1 system. To offer the few shell users I have more hosts to irc and other things from. I know its going to be alias's for my eth0, something like eth0:1 through 7 (eth0 being the first one.) But I have never actually done this before. What is the 'gentoo' way to do this? I imagine it should be done in the net.eth0 script. Any help is appricaited. |
|
Back to top |
|
|
klieber Bodhisattva
Joined: 17 Apr 2002 Posts: 3657 Location: San Francisco, CA
|
Posted: Thu May 30, 2002 8:23 pm Post subject: |
|
|
Look at /etc/conf.d/net. There's a section in there for adding aliases to an eth interface.
--kurt _________________ The problem with political jokes is that they get elected |
|
Back to top |
|
|
wizy Tux's lil' helper
Joined: 26 May 2002 Posts: 133
|
Posted: Thu May 30, 2002 8:26 pm Post subject: Thanks |
|
|
Thank you for the help. |
|
Back to top |
|
|
roman n00b
Joined: 20 May 2002 Posts: 17
|
Posted: Fri May 31, 2002 12:17 pm Post subject: |
|
|
There is "possibly" bug in gentoo, 'cause as ip aliasing howto says, you
must add route for each aliased card so:
Code: | /sbin/route add -host <first ip> dev eth0
/sbin/route add -host <second ip> dev eth0:0
/sbin/route add -host <third ip> dev eth0:1
etc... |
I've added it to /etc/conf.d/local.start and now all works nicely
Roman. |
|
Back to top |
|
|
wizy Tux's lil' helper
Joined: 26 May 2002 Posts: 133
|
Posted: Fri May 31, 2002 9:44 pm Post subject: just got to the point where i was looking at it |
|
|
it has:
#alias_eth0="192.168.0.3 192.168.0.4"
and
#broadcast_eth0="192.168.0.255"
#netmask_eth0="255.255.255.0"
I have 7 more ip's I want to add to this computer. Ive got the main ifconfig lines setup. they work fine with the first ip. What do I do here to put the other 7 in. I mean, what is the .3 and the .4 is the .3 the eth0 ip and the .4 the new alias? |
|
Back to top |
|
|
klieber Bodhisattva
Joined: 17 Apr 2002 Posts: 3657 Location: San Francisco, CA
|
Posted: Fri May 31, 2002 9:56 pm Post subject: Re: just got to the point where i was looking at it |
|
|
wizy wrote: | #alias_eth0="192.168.0.3 192.168.0.4" |
Change that to:
Code: | alias_eth0="192.168.0.3"
alias_eth0:1="192.168.0.4" |
and it *should* work. Away from my Gentoo box at the moment, so I can't test it.
--kurt _________________ The problem with political jokes is that they get elected |
|
Back to top |
|
|
wizy Tux's lil' helper
Joined: 26 May 2002 Posts: 133
|
Posted: Fri May 31, 2002 10:00 pm Post subject: umm |
|
|
But the ip for eth0 is set on the main ifconfig line up above? do I need to set that again? |
|
Back to top |
|
|
klieber Bodhisattva
Joined: 17 Apr 2002 Posts: 3657 Location: San Francisco, CA
|
Posted: Fri May 31, 2002 10:13 pm Post subject: Re: umm |
|
|
wizy wrote: | But the ip for eth0 is set on the main ifconfig line up above? do I need to set that again? |
No -- just set it once. alias_eth0 should be your second IP address, alias_eth0:1 your third, and so on. (again, I haven't tested anything beyond two IPs on the same computer, so please let us know if this works)
--kurt _________________ The problem with political jokes is that they get elected |
|
Back to top |
|
|
wizy Tux's lil' helper
Joined: 26 May 2002 Posts: 133
|
Posted: Fri May 31, 2002 10:23 pm Post subject: actually.. |
|
|
Its easier than all of that
Code: | alias_eth0="IP IP IP IP" |
It is a space separated list of ip's to create alias's from. So that one above would create eth0:0 eth0:1 eth0:2 and eth0:3 each with those ip's specified in the space delimited variable. Quite simple now that ive got it working. I like gentoo more and more every time I find something like this. |
|
Back to top |
|
|
|