Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
bridging with iproute2 syntax in operc?
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
WWWW
Tux's lil' helper
Tux's lil' helper


Joined: 30 Nov 2014
Posts: 143

PostPosted: Sun Nov 29, 2015 12:11 am    Post subject: bridging with iproute2 syntax in operc? Reply with quote

hello,

Bridging with bridge-utils is documented enough and well supported in openrc net scripts.

These two examples where provided by another user:

The manual way

Code:
tunctl -t tap0
brctl addbr br0
brctl addif br0 enp2s0
brctl addif br0 tap0
ifconfig enp2s0 up
ifconfig br0 up
ifconfig tap0 up


And the automated way that goes into /etc/conf.d/net:
Code:

config_br0="null"
config_enp2s0="null"
config_tap0="null"
tuntap_tap0="tap"
bridge_br0="enp2s0 tap0"
rc_net_br0_need="net.enp2s0 net.tap0"


But the same set up can be done with iproute2 yet there's ZERO documentation about openrc iproute2's syntax.

While I can set up some things manually with iproute2 it has always been a mystery how can it be use under an automated manner in openrc.

Both Fedora and Arch linux have syntax to use iproute2 in their scripts. Is Gentoo falling behind.

Another confusing aspect in openrc net script syntax is this bit:

Code:

module="ifconfig dhcpcd"


Supposedly this tells which programs prefer to configure the networking interfaces, routes and all that.

Does this mean that if I set the option to use iproute2 it will use it to set up ALL networking?

Lets take the bridging example above under module="iproute2", will openrc call iproute2?

Code:

config_br0="null"            <--- with iproute2
config_enp2s0="null"     <--- with iproute2
config_tap0="null"          <--- with iproute3
tuntap_tap0="tap"          >--- with iproute1/2
bridge_br0="enp2s0 tap0"  ---> with iproute2
rc_net_br0_need="net.enp2s0 net.tap0" -><-- with iproute2


In other words, whether openrc's syntax config_foo are able to do their stuff with iproute2's.


If there's not straight way for this answer is there a plan B in Gentoo such a personal script where I can drop iproute2's commands?

A compelling answer to do this could be 'why do you wanna do X when bridge-utils do the same?'. Well I am facing a scenario where there's no tun/tap (traditional way) kernel module but macvtap (iproute2's module) IS available.

The compelling reply to this would be 'why no configure your kernel with it?'. Yes I could compile it, but the system is so stitched together with outside the handbook installation that I risk of non-bootable system if I touch it to much.

Bottomline macvtap is available and I want to use it to solve this.

Thanks.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 6968

PostPosted: Sun Nov 29, 2015 5:53 am    Post subject: Reply with quote

iproute2 is use per default, but openrc (netifrc in fact) can use ifconfig or iproute2.
/usr/share/doc/netifrc-version/net.example.bz2 wrote:
##############################################################################
# INTERFACE HANDLERS
#
# We provide two interface handlers presently: ifconfig and iproute2.
# You need one of these to do any kind of network configuration.
# For ifconfig support, emerge sys-apps/net-tools
# For iproute2 support, emerge sys-apps/iproute2

# If you don't specify an interface then we prefer iproute2 if it's installed
# To prefer ifconfig over iproute2
#modules="!iproute2"
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sun Nov 29, 2015 6:19 am    Post subject: Re: bridging with iproute2 syntax in operc? Reply with quote

WWWW wrote:
Another confusing aspect in openrc net script syntax is this bit:

Code:
module="ifconfig dhcpcd"

Supposedly this tells which programs prefer to configure the networking interfaces, routes and all that. Does this mean that if I set the option to use iproute2 it will use it to set up ALL networking?

WWWW ... as krinn points out iproute2 is the default (and as this package was added to the base profile should be installed), however that var won't work (if you happen to be copy-pasting, rather than this being a typo) its 'modules' not 'module', eg:

/etc/conf.d/net:
modules="!ifconfig iproute2"

... or 'modules_{iface}=' to be more specific wrt the device ... and note '!' nots, though again, iproute is the default so the above is what you get without anything defined.

best ... khay
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