Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
server with multiple aliases and routes: how in conf.d/net?
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
superwutze
Tux's lil' helper
Tux's lil' helper


Joined: 09 Dec 2004
Posts: 137
Location: Europe/Vienna

PostPosted: Mon Jul 24, 2006 10:34 am    Post subject: server with multiple aliases and routes: how in conf.d/net? Reply with quote

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
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Mon Jul 24, 2006 4:19 pm    Post subject: Re: server with multiple aliases and routes: how in conf.d/n Reply with quote

Code:

routes_eth0=(
   "default gw a.b.c.193"
   "default gw d.e.f.193 metric 5"
 )


Should work
_________________
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
superwutze
Tux's lil' helper
Tux's lil' helper


Joined: 09 Dec 2004
Posts: 137
Location: Europe/Vienna

PostPosted: Mon Jul 24, 2006 7:56 pm    Post subject: Reply with quote

thanks!

i used the form you gave me, but it will hopefully take some years to the next reboot :D
_________________
bill who? micro what?
Back to top
View user's profile Send private message
Django
n00b
n00b


Joined: 29 Jul 2002
Posts: 47
Location: Shelburne, ON (Middle o' frikkin nowhere)

PostPosted: Mon Jul 24, 2006 9:58 pm    Post subject: Re: server with multiple aliases and routes: how in conf.d/n Reply with quote

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


Joined: 09 Dec 2004
Posts: 137
Location: Europe/Vienna

PostPosted: Mon Jul 24, 2006 10:19 pm    Post subject: Reply with quote

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


Joined: 29 Jul 2002
Posts: 47
Location: Shelburne, ON (Middle o' frikkin nowhere)

PostPosted: Tue Jul 25, 2006 4:15 pm    Post subject: Reply with quote

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