Ticket #119 (closed defect: fixed)

Opened 23 months ago

Last modified 20 months ago

Add possibility to pass default route without -host (for p2p interfaces)

Reported by: pva@gentoo.org Owned by: roy
Priority: major Milestone:
Component: rc Version: 0.2
Keywords: Cc:

Description

My intension is to configure default route to point on interface. IOW to configure routing like could be done with the following command:
# ip route add default dev venet0

This useful for openvz containers where point-to-point interfaces exist. May be useful in some other scenarios, like vpn or other.

In /etc/conf.d/net I have:

routes_dev="default"

While this works with iproute2 this does not works with net-tools. There reason is that openrc conciders "default" route to be host and adds -host to $cmd. specific snipplet from net.lo:

case ${cmd} in

-net" "*host" "*);;

*" "netmask" "*) cmd="-net ${cmd}";;
*.*.*.*/32*) cmd="-host ${cmd}";;
*.*.*.*/*|0.0.0.0" "*|default" "*) cmd="-net ${cmd}";;
*) cmd="-host ${cmd}";;

esac

In "default" case only last line does works and thus
# route add -host default metric 2 dev venet0
is called. I think this is wrong as "default" is network and either -net passed or nothing as
# route add default dev venet0
works too. Possible sollutions are:
remove " "*:

  • *.*.*.*/*|0.0.0.0" "*|default" "*) cmd="-net ${cmd}";;

+ *.*.*.*/*|0.0.0.0" "*|default) cmd="-net ${cmd}";;

or don't path anything for default, like it is skipped in iprote2.sh:

+ default*) cmd="${cmd}";;

*.*.*.*/*|0.0.0.0" "*) cmd="-net ${cmd}";;

What do you think, Roy?

Attachments

default.diff Download (576 bytes) - added by roy 23 months ago.
Allow the route "default" to work properly

Change History

Changed 23 months ago by roy

Allow the route "default" to work properly

comment:1 follow-up: ↓ 2 Changed 23 months ago by roy

  • Status changed from new to accepted

Does that patch work for you?

comment:2 in reply to: ↑ 1 Changed 23 months ago by anonymous

Replying to roy:

Does that patch work for you?

Yes.

comment:3 Changed 23 months ago by roy

  • Status changed from accepted to closed
  • Resolution set to fixed

Fixed  here, thanks

comment:4 Changed 20 months ago by anonymous

Note: See TracTickets for help on using tickets.