Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Configuration of aliased static ips, static routes? [SOLVED]
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
Clansman
Tux's lil' helper
Tux's lil' helper


Joined: 10 Jan 2004
Posts: 140

PostPosted: Mon Jun 12, 2006 1:35 pm    Post subject: Configuration of aliased static ips, static routes? [SOLVED] Reply with quote

Hi everyone,

[long time no post heh?]

I'm having this issue that annoys me to death! I've been using, administrating and installing gentoo desktops and servers for 3 years now, and I've really enjoyed using, administrating, installing and seeing it grow over time. Some of my 2003 installations still stand, updated and working perfectly with minimum maintenance effort.

I'm installing a new server for a friend (starting from gentoo 2006.0 hardened stage3) and it's giving me some issues with the network configuration.
One of the network cards will have about 3-5 ips (2-4 alias) and a couple of static routes, at the time of installation.

By looking at /etc/conf.d/net.example, I inferred that the following configuration would work:
Code:

#modules="iproute2"
config_ethLAN=( "192.168.1.126/25 broadcast 192.168.1.127" "192.168.1.1/25 broadcast 192.168.1.127" )
routes_ethLAN=( "192.168.0.0/24 dev ethLAN" "default via 192.168.0.254" )


It doesn't. The NIC starts up ok with all aliases, but both routes fail do setup correctly.
If I force the iproute2 module, the NIC starts up ok but without aliases (it get's configured with the first ip as explained in /etc/conf.d/net.example) but the routes show up fine.

This setup works perfectly if things are setup manually.

Now for the questions:
1. How can I configure such a setup?
2. If iproute2 can't handle creating alias with the "space separated ip definition" syntax, how is it done then? How are aliases created with iproute2?
3. Why are the routes failing (with ifconfig)?

Cheers everyone,
_________________
http://www.pjvenda.org


Last edited by Clansman on Mon Jun 12, 2006 8:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Mon Jun 12, 2006 2:43 pm    Post subject: Re: Configuration of aliased static ips, static routes? Reply with quote

Clansman wrote:

By looking at /etc/conf.d/net.example, I inferred that the following configuration would work:
Code:

#modules="iproute2"
config_ethLAN=( "192.168.1.126/25 broadcast 192.168.1.127" "192.168.1.1/25 broadcast 192.168.1.127" )
routes_ethLAN=( "192.168.0.0/24 dev ethLAN" "default via 192.168.0.254" )


You don't need to specify dev ethLAN in the route setup as that's inferred by routes_ethLAN ;)

Quote:

It doesn't. The NIC starts up ok with all aliases, but both routes fail do setup correctly.

Probably a bug - sounds like you're using baselayout-1.11, should be fixed in baselayout-1.12
Quote:

If I force the iproute2 module, the NIC starts up ok but without aliases (it get's configured with the first ip as explained in /etc/conf.d/net.example) but the routes show up fine.


iproute2 does not need aliases :)
Code:
ip addr show dev ethLAN


There you go :)
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
Clansman
Tux's lil' helper
Tux's lil' helper


Joined: 10 Jan 2004
Posts: 140

PostPosted: Mon Jun 12, 2006 3:13 pm    Post subject: Re: Configuration of aliased static ips, static routes? Reply with quote

UberLord wrote:

You don't need to specify dev ethLAN in the route setup as that's inferred by routes_ethLAN ;)


uhh, looks obvious. sorry.

Quote:
Quote:

It doesn't. The NIC starts up ok with all aliases, but both routes fail do setup correctly.

Probably a bug - sounds like you're using baselayout-1.11, should be fixed in baselayout-1.12


hmm, can't check right now, but is baselayout 1.12 already x86 (as opposed to ~x86)?

Quote:
Quote:

If I force the iproute2 module, the NIC starts up ok but without aliases (it get's configured with the first ip as explained in /etc/conf.d/net.example) but the routes show up fine.


iproute2 does not need aliases :)
Code:
ip addr show dev ethLAN



I don't get it. iproute2 doesn't need aliases, but I do :-)

Thanks for your kind reply.

Cheers,
_________________
http://www.pjvenda.org
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Mon Jun 12, 2006 3:46 pm    Post subject: Re: Configuration of aliased static ips, static routes? Reply with quote

Clansman wrote:

hmm, can't check right now, but is baselayout 1.12 already x86 (as opposed to ~x86)?


Not yet.

Quote:
I don't get it. iproute2 doesn't need aliases, but I do :-)


Why do *you* need aliases? It's not a new interface - you cannot bind to it or use it in firewall rules.
If you need it working with aliases then I suggest you use baselayout-1.12 and force the ifconfig module as that defaults to iproute2.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
Clansman
Tux's lil' helper
Tux's lil' helper


Joined: 10 Jan 2004
Posts: 140

PostPosted: Mon Jun 12, 2006 4:26 pm    Post subject: Re: Configuration of aliased static ips, static routes? Reply with quote

Thanks for the quick tips :-)

2 examples just popped for alias usage:
- tinydns and dnscachex don't work on the same address;
- ip based vhosting for ssl websites;

Why do you say that I can't bind to it or use it in firewall rules? About the firewall, I didn't try, but I sure can bind an application to a specific address - an aliased address in particular!

Cheers,
_________________
http://www.pjvenda.org
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Mon Jun 12, 2006 4:32 pm    Post subject: Re: Configuration of aliased static ips, static routes? Reply with quote

Clansman wrote:
2 examples just popped for alias usage:
- tinydns and dnscachex don't work on the same address;
- ip based vhosting for ssl websites;


Huh? They bind to a specific IP address - not an alias

Quote:
Why do you say that I can't bind to it or use it in firewall rules? About the firewall, I didn't try, but I sure can bind an application to a specific address - an aliased address in particular!


Again, you're binding to a specific address - not an alias. The fact that the address is aliased from an interface does not matter.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
Clansman
Tux's lil' helper
Tux's lil' helper


Joined: 10 Jan 2004
Posts: 140

PostPosted: Mon Jun 12, 2006 4:59 pm    Post subject: Re: Configuration of aliased static ips, static routes? Reply with quote

UberLord wrote:
Again, you're binding to a specific address - not an alias. The fact that the address is aliased from an interface does not matter.


Whoops!! My mistake. I was convinced that "multiple ips on an interface" meant "aliases". It seems that it isn't so anymore.

Thanks a lot and sorry for the noise.

Cheers,
_________________
http://www.pjvenda.org
Back to top
View user's profile Send private message
Clansman
Tux's lil' helper
Tux's lil' helper


Joined: 10 Jan 2004
Posts: 140

PostPosted: Mon Jun 12, 2006 8:39 pm    Post subject: Reply with quote

It's me again;

I've read some iproute2 manpage, updated baselayout to 1.12 and retouched /etc/conf.d/net.
Works beautifully now. Thanks for the advices!

Cheers,
_________________
http://www.pjvenda.org
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