Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
multiple ip's on the same computer
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
wizy
Tux's lil' helper
Tux's lil' helper


Joined: 26 May 2002
Posts: 133

PostPosted: Thu May 30, 2002 7:05 pm    Post subject: multiple ip's on the same computer Reply with quote

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
View user's profile Send private message
klieber
Administrator
Administrator


Joined: 17 Apr 2002
Posts: 3657
Location: San Francisco, CA

PostPosted: Thu May 30, 2002 8:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
wizy
Tux's lil' helper
Tux's lil' helper


Joined: 26 May 2002
Posts: 133

PostPosted: Thu May 30, 2002 8:26 pm    Post subject: Thanks Reply with quote

Thank you for the help.
Back to top
View user's profile Send private message
roman
n00b
n00b


Joined: 20 May 2002
Posts: 17

PostPosted: Fri May 31, 2002 12:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
wizy
Tux's lil' helper
Tux's lil' helper


Joined: 26 May 2002
Posts: 133

PostPosted: Fri May 31, 2002 9:44 pm    Post subject: just got to the point where i was looking at it Reply with quote

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
View user's profile Send private message
klieber
Administrator
Administrator


Joined: 17 Apr 2002
Posts: 3657
Location: San Francisco, CA

PostPosted: Fri May 31, 2002 9:56 pm    Post subject: Re: just got to the point where i was looking at it Reply with quote

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
View user's profile Send private message
wizy
Tux's lil' helper
Tux's lil' helper


Joined: 26 May 2002
Posts: 133

PostPosted: Fri May 31, 2002 10:00 pm    Post subject: umm Reply with quote

But the ip for eth0 is set on the main ifconfig line up above? do I need to set that again?
Back to top
View user's profile Send private message
klieber
Administrator
Administrator


Joined: 17 Apr 2002
Posts: 3657
Location: San Francisco, CA

PostPosted: Fri May 31, 2002 10:13 pm    Post subject: Re: umm Reply with quote

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
View user's profile Send private message
wizy
Tux's lil' helper
Tux's lil' helper


Joined: 26 May 2002
Posts: 133

PostPosted: Fri May 31, 2002 10:23 pm    Post subject: actually.. Reply with quote

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
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