Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 671656 - same VLAN ID on different interfaces
Summary: same VLAN ID on different interfaces
Status: UNCONFIRMED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: netifrc (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: netifrc Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-21 20:29 UTC by Vieri
Modified: 2018-11-27 10:27 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vieri 2018-11-21 20:29:53 UTC
This sample /etc/conf.d/net configuration should work:

vlans_enp5s0="1 11 12"
vlan1_name="enp5s0_1"
vlan11_name="enp5s0_11"
vlan12_name="enp5s0_12"
config_enp5s0="null"
config_enp5s0_1="null"
config_enp5s0_11="null"
config_enp5s0_12="null"
bridge_dmzbr="enp5s0 enp5s0_1 enp5s0_11"
config_dmzbr="192.168.210.1/23 192.168.212.1/24"
bridge_forward_delay_dmzbr=0
bridge_hello_time_dmzbr=1000
enable_ipv6_dmzbr="false"

vlans_enp8s5="1 12 13 14 15"
vlan1_name="enp8s5_1"
vlan12_name="enp8s5_12"
vlan13_name="enp8s5_13"
vlan14_name="enp8s5_14"
vlan15_name="enp8s5_15"
config_enp8s5="null"
config_enp8s5_1="null"
config_enp8s5_12="null"
config_enp8s5_13="null"
config_enp8s5_14="null"
config_enp8s5_15="null"
bridge_lanbr="enp8s5 enp8s5_1 enp5s0_12 enp8s5_12 enp8s5_13 enp8s5_14 enp8s5_15"
config_lanbr="192.168.215.1/24"
bridge_forward_delay_lanbr=0
bridge_hello_time_lanbr=1000
enable_ipv6_lanbr="false" 

However, it fails to add VLAN IDs 1 and 12 if I run:
/etc/init.d/net.enp5s0 start
/etc/init.d/net.enp8s5 start

Manually running the following afterwards works OK:

ip link add link enp8s5 name enp8s5_1 type vlan id 1
ip link set dev enp8s5_1 up 

So it must be a net config issue.

Also, enable_ipv6_*="false" does not seem to work as expected. The interface still tries to get an IPv6 address via DHCP but times out after 5 seconds. It would be great if I could disable it completely.
Comment 1 Vieri 2018-11-22 08:14:51 UTC
net-misc/netifrc-0.5.1::gentoo was built with the following:
USE="" ABI_X86="(64)"

# emerge --info
Portage 2.3.6 (python 3.4.5-final-0, default/linux/amd64/17.0, gcc-5.4.0, glibc-2.23-r4, 4.9.34-gentoo x86_64)
=================================================================
System uname: Linux-4.9.34-gentoo-x86_64-AMD_FX-tm-8320_Eight-Core_Processor-with-gentoo-2.3
KiB Mem:    32865056 total,  29147648 free
KiB Swap:   37036988 total,  37036988 free
Timestamp of repository gentoo: Fri, 13 Apr 2018 10:00:01 +0000
sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.28 p1.2) 2.28
app-shells/bash:          4.3_p48-r1::gentoo
dev-lang/perl:            5.24.1-r2::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/openrc:          0.26.3::gentoo
sys-apps/sandbox:         2.10-r3::gentoo
sys-devel/autoconf:       2.69::gentoo
sys-devel/automake:       1.15.1-r2::gentoo
sys-devel/binutils:       2.28-r2::gentoo
sys-devel/gcc:            5.4.0-r3::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r4::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

CustomOverlay
    location: /usr/local/portage
    masters: gentoo

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/lib64/fax /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /var/bind /var/spool/fax/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.0/ext-active/ /etc/php/cgi-php7.0/ext-active/ /etc/php/cli-php7.0/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news nostrip parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j9"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl ads amd64 apache2 berkdb bzip2 cli cluster crypt cxx dri fortran freetds gdbm iconv ipv6 jbig kerberos ldap logrotate modules multilib ncurses nls nptl odbc openmp openrc pam pcre python radius readline samba seccomp ssl tcpd unicode winbind xattr zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="prefork" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx f16c fma3 fma4 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 xop" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64 pc" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python2_7 python3_5" RUBY_TARGETS="ruby22 ruby23" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2018-11-24 04:54:57 UTC
You're trampling your own variables (trimmed here from your config):
> vlan1_name="enp5s0_1"
> vlan12_name="enp5s0_12"
> vlan1_name="enp8s5_1"
> vlan12_name="enp8s5_12"

Looking at the complexity of this configuration, esp. mixing tagged & untagged on the same interface, I would strongly suggest looking at openvswitch
Comment 3 Vieri 2018-11-24 17:13:45 UTC
Thanks for pointing out openvswitch, but I find it to be overkill for my purposes.

How can I avoid trampling my variables in conf.d/net?

How should I go about creating VLAN 1 on BOTH network interfaces?

vlan1_name="enp5s0_1"
vlan1_name="enp8s5_1"

The second line obviously overrides the first one.

Can it be that netifrc did not foresee the possibility of setting up the same vlan ID on two different NICs?

Like I said in my first post, I can ignore the error (or remove the second vlan 1, 12 settings) and run:

/etc/init.d/net.enp5s0 start
/etc/init.d/net.enp8s5 start
ip link add link enp8s5 name enp8s5_1 type vlan id 1
ip link set dev enp8s5_1 up 
ip link add link enp8s5 name enp8s5_12 type vlan id 12
ip link set dev enp8s5_12 up 
/etc/init.d/net.dmzbr start
/etc/init.d/net.lanbr start

Ugly, but does the job.

Do you think netifrc can support this kind of vlan setup in the future?

Also, any ideas regarding enable_ipv6_*="false" not working as expected?
Comment 4 Vieri 2018-11-24 17:28:26 UTC
Would omitting vlan*_name variables altogether in my conf.d/net do the trick, albeit the interface names would not be customizable? ie. 'ip link show' would yield interface names such as 

enp5s0.12@enp5s0
enp8s5.12@enp8s5

instead of

enp5s0_12@enp5s0
enp8s5_12@enp8s5
Comment 5 Vieri 2018-11-26 10:43:46 UTC
(In reply to Vieri from comment #4)
> Would omitting vlan*_name variables altogether in my conf.d/net do the
> trick

I'll answer myself. I tried it, and it seems to work fine.
Now I get interfaces such as:

26: enp5s0.12@enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
28: enp8s5.12@enp8s5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000

I can live without being able to customize their names.
Comment 6 Vieri 2018-11-27 07:03:15 UTC
However....

I'm getting this error when trying to start an interface:

/etc/init.d/../conf.d/net: line 23: config_enp5s0.1=null: command not found

The problem is with the "dot" after the interface name and the VLAN ID number.

Tried escaping it, but no joy.

Any ideas?
Comment 7 Vieri 2018-11-27 10:27:26 UTC
(In reply to Vieri from comment #6)
> /etc/init.d/../conf.d/net: line 23: config_enp5s0.1=null: command not found

OK, never mind. I fixed it by replacing the dot with an underscore _.

So basically, my only real concern now is with enable_ipv6_*="false", but I guess that if I disable ipv6 system-wide, I shouldn't have any issues here either.