View previous topic :: View next topic |
Author |
Message |
superwutze Tux's lil' helper
Joined: 09 Dec 2004 Posts: 137 Location: Europe/Vienna
|
Posted: Mon Jul 24, 2006 10:34 am Post subject: server with multiple aliases and routes: how in conf.d/net? |
|
|
hello!
we have a webserver running with multiple ip-addresses on the same interface in different subnets. of course they do have different routes with different metric, but is there any way to make that via conf.d/net?
current setting:
/etc/conf.d/net:
Code: | config_eth0=( "a.b.c.196 netmask 255.255.255.248 brd a.b.c.199"
"d.e.f.24 netmask 255.255.255.224 brd d.e.f.31" )
routes_eth0=( "default gw a.b.c.193" ) |
/etc/conf.d/local.start
Code: | route add default gw d.e.f.1 metric 5 |
i searched a lot but the routes feature of conf.d/net is not well documented for alias-interfaces.
thanks in advance,
andy _________________ bill who? micro what? |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
superwutze Tux's lil' helper
Joined: 09 Dec 2004 Posts: 137 Location: Europe/Vienna
|
Posted: Mon Jul 24, 2006 7:56 pm Post subject: |
|
|
thanks!
i used the form you gave me, but it will hopefully take some years to the next reboot _________________ bill who? micro what? |
|
Back to top |
|
|
Django n00b
Joined: 29 Jul 2002 Posts: 47 Location: Shelburne, ON (Middle o' frikkin nowhere)
|
Posted: Mon Jul 24, 2006 9:58 pm Post subject: Re: server with multiple aliases and routes: how in conf.d/n |
|
|
UberLord wrote: | Code: |
routes_eth0=(
"default gw a.b.c.193"
"default gw d.e.f.193 metric 5"
) |
Should work |
_Why_ should it work?
I have a similar problem where I have a server on a network which needs two routes defining.
There is a default gateway, which goes outside the LAN, and a vpn router for internal site to site traffic.
netstat -rn gives me:
Code: | hydra01 ~ # netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.0.0 192.168.1.200 255.255.0.0 UG 0 0 0 eth0
127.0.0.0 127.0.0.1 255.0.0.0 UG 0 0 0 lo
0.0.0.0 192.168.1.202 0.0.0.0 UG 0 0 0 eth0
|
How can I define this in conf.d/net?
Cheers, _________________ Django |
|
Back to top |
|
|
superwutze Tux's lil' helper
Joined: 09 Dec 2004 Posts: 137 Location: Europe/Vienna
|
Posted: Mon Jul 24, 2006 10:19 pm Post subject: |
|
|
afaik it should look this:
Code: | routes_eth0=(
"default gw 192.168.1.202"
"-net 192.168.0.0/24 gw 192.168.1.200") |
_________________ bill who? micro what? |
|
Back to top |
|
|
Django n00b
Joined: 29 Jul 2002 Posts: 47 Location: Shelburne, ON (Middle o' frikkin nowhere)
|
Posted: Tue Jul 25, 2006 4:15 pm Post subject: |
|
|
superwutze wrote: | afaik it should look this:
Code: | routes_eth0=(
"default gw 192.168.1.202"
"-net 192.168.0.0/24 gw 192.168.1.200") |
|
You, sir, are a star.
With a minor modification that looks kinda like this:
Code: | config_eth0=( "192.168.1.10 netmask 255.255.255.0 broadcast 192.168.1.255" )
routes_eth0=(
"default gw 192.168.1.202"
"-net 192.168.0.0/16 gw 192.168.1.200"
"-net 10.0.0.0/8 gw 192.168.1.200"
"-net 128.0.0.0/8 gw 192.168.1.200"
)
|
My routes are set as needed to access out VPN'd subnets (including two client networks) _________________ Django |
|
Back to top |
|
|
|