jirutka/one-context

additional routes in /etc/conf.d/net (00-network)

Opened this issue · 2 comments

Hello @jirutka

First thanks for your great work. Very usefull. Can i ask for a network feature? Some hosting providers route additional ip addresses directly to the main ip of a dedicted server forcing to configure a host route like this in the virtual machine:

config_eth0="88.99.xx.xx/32"
routes_eth0="37.23.xx.xx
default via 37.23.xx.xx"

As you can see the default gateway is not part of the ip network assigned to eth0.

Is it possible to add such a construct to 00-network if the ip addr has a netmask of 255.255.255.255? Maybe you have another idea?

thanks again and cheers
t.

I'm not sure if I understand your setup. You have two IPv4 addresses on single interface a need to explicitly define default gateway, right?

No. I have only one ipv4 addr on a single interface. but the gateway i have to use is not part of the subnet of that ipv4 addr. here another example:

ipv4 addr: 135.123.122.17 netmask: 255.255.255.255
gateway: 97.17.16.151

as you can see there is no way to reach the gateway without setting a host route first. i can do it at the command line with:

ip route add 97.17.16.151 dev eth0
ip route add default via 97.17.16.151

this can be accomplished with this setting in /etc/conf.d/net.

routes_eth0="97.17.16.151
default via 97.17.16.151"

hope that clears things up.

thanks and cheers
t.