Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Need to configure vlans on Gentoo
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
manu_leo
Guru
Guru


Joined: 20 Jan 2014
Posts: 453
Location: India

PostPosted: Sat Jul 26, 2014 4:45 am    Post subject: Need to configure vlans on Gentoo Reply with quote

Hi Experts. I am trying to configure vlans on my Gentoo server but somehow when I restart the network services after vlan configuration, the sub-interfaces are not able to get an ip.


Newton ~ # cat /usr/src/linux/.config | grep VLAN
CONFIG_VLAN_8021Q=y
# CONFIG_VLAN_8021Q_GVRP is not set
# CONFIG_VLAN_8021Q_MVRP is not set
# CONFIG_MACVLAN is not set


vim /etc/config.d/net

vlans_enp4s0f1="1761 3299"

config_enp4s0f1=("0.0.0.0")
config_enp4s0f1_3299=("172.17.231.252 netmask 255.255.255.248 broadcast 172.17.231.255")
config_enps0f1_1761=("10.253.1.4 netmask 255.255.255.248 broadcast 10.253.1.7")

cd /etc/init.d

Newton init.d # ls -lth net*
lrwxrwxrwx 1 root root 6 Jul 25 23:22 net.enp4s0f1.1761 -> net.lo
lrwxrwxrwx 1 root root 6 Jul 15 11:13 net.enp4s0f1.3299 -> net.lo

/etc/init.d/net.lo restart
/etc/init.d/net.enps0f1 restart

* Bringing down interface enp4s0f1
* Removing VLAN 1761 from enp4s0f1
* Bringing down interface enp4s0f1.1761
* Removing VLAN 3299 from enp4s0f1
* Bringing down interface enp4s0f1.3299
* Bringing up interface enp4s0f1
* You are using a bash array for config_enp4s0f1.
* This feature will be removed in the future.
* Please see net.example for the correct format for config_enp4s0f1.
* 0.0.0.0 ... [ ok ]
* Waiting for IPv6 addresses ... [ ok ]
* Adding VLAN 1761 to enp4s0f1
* Bringing up interface enp4s0f1.1761
* config_enp4s0f1_1761 not specified; defaulting to DHCP
* dhcp ...
* Running udhcpc ... [ ok ]
* received address [ ok ]

* Waiting for IPv6 addresses ... [ ok ]
* Adding VLAN 3299 to enp4s0f1
* Bringing up interface enp4s0f1.3299
* You are using a bash array for config_enp4s0f1_3299.
* This feature will be removed in the future.
* Please see net.example for the correct format for config_enp4s0f1_3299.
* 172.17.231.252 ... [ ok ]
* Waiting for IPv6 addresses ...

It says 'config_enp4s0f1_1761 not specified; defaulting to DHCP', but I have specified the ip for this vlan under /etc/config.d/net file.

Please suggest what I am missing here. Appreciate all your help in advance.
Back to top
View user's profile Send private message
manu_leo
Guru
Guru


Joined: 20 Jan 2014
Posts: 453
Location: India

PostPosted: Sat Jul 26, 2014 4:50 am    Post subject: Reply with quote

Just to add, when I manually bring the sub-interfaces up, they work just fine.

ifconfig enp4s0f1.1761 10.253.1.4 netmask 255.255.255.248 broadcast 10.253.1.7 up


ifconfig
enp4s0f1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::20f:53ff:fe25:ef41 prefixlen 64 scopeid 0x20<link>
ether 00:0f:53:25:ef:41 txqueuelen 1000 (Ethernet)
RX packets 464594039 bytes 98493659971 (91.7 GiB)
RX errors 0 dropped 172 overruns 0 frame 0
TX packets 154656 bytes 9910996 (9.4 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 44

enp4s0f1.1761: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.253.1.4 netmask 255.255.255.248 broadcast 10.253.1.7
inet6 fe80::20f:53ff:fe25:ef41 prefixlen 64 scopeid 0x20<link>
ether 00:0f:53:25:ef:41 txqueuelen 0 (Ethernet)
RX packets 9 bytes 504 (504.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 17 bytes 1614 (1.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

enp4s0f1.3299: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.17.231.252 netmask 255.255.255.248 broadcast 172.17.231.255
inet6 fe80::20f:53ff:fe25:ef41 prefixlen 64 scopeid 0x20<link>
ether 00:0f:53:25:ef:41 txqueuelen 0 (Ethernet)
RX packets 4 bytes 168 (168.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8 bytes 648 (648.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


How can I make sure that whenever the sever is rebooted or the network services are restarted, the interfaces and sub-interfaces automatically comes up by itself.
Back to top
View user's profile Send private message
marialuiza
n00b
n00b


Joined: 24 Jul 2014
Posts: 2

PostPosted: Sat Jul 26, 2014 10:21 am    Post subject: Reply with quote

you can also simple consult your service provider for that also as he or she may be able to provide you the answers and solutions for your this problem also
Back to top
View user's profile Send private message
manu_leo
Guru
Guru


Joined: 20 Jan 2014
Posts: 453
Location: India

PostPosted: Sat Jul 26, 2014 1:11 pm    Post subject: Reply with quote

What ?? Why I need to get in touch with my provider ?? Am I not clear with my query/question.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7553
Location: Goose Creek SC

PostPosted: Sat Jul 26, 2014 5:26 pm    Post subject: Reply with quote

Quote:
vim /etc/config.d/net
Is this a typo here only? If not, does /etc/init.d/net.lo know that it should be looking in a nonstandard location for its configuration?

Quote:
config_enp4s0f1="0.0.0.0"
config_enp4s0f1_3299="172.17.231.252 netmask 255.255.255.248 broadcast 172.17.231.255"
config_enps0f1_1761="10.253.1.4 netmask 255.255.255.248 broadcast 10.253.1.7"
to eliminate obsolete bash format
_________________
Defund the FCC.
Back to top
View user's profile Send private message
manu_leo
Guru
Guru


Joined: 20 Jan 2014
Posts: 453
Location: India

PostPosted: Sat Jul 26, 2014 6:37 pm    Post subject: Reply with quote

Thanks Donahue for looking into this. I was not sure about this, do I need to make an entry for 'module=iproute2'" under /etc/config.d/net ? The doc says that the module for iproute2 should be there which I have installed unsing emerge.

Could you help me with the sameple config example for the configuration of vlans using iproute2.

Appreciate all your help.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7553
Location: Goose Creek SC

PostPosted: Sat Jul 26, 2014 6:58 pm    Post subject: Reply with quote

had not done this for years, so I and the document are both out of date.
Code:
emerge iproute2
for sure

Quote:
#-----------------------------------------------------------------------------
# VLAN (802.1q support)
# For VLAN support, emerge sys-apps/iproute2
# The old vconfig based VLAN support is no longer available.

# Specify the VLAN numbers for the interface like so
# Please ensure your VLAN IDs are NOT zero-padded
#vlans_eth0="1 2"

# You may not want to assign an IP the the physical interface, but we still
# need it up.
#config_eth0="null"

# You can also configure the VLAN - see for ip man page for more details
# To change the vlan interface name. If not set, the standard "iface.vlanid"
# will be used. This is the replacement for the old 'vconfig set_name_type'
# functionality. If you previously relied on the DEV_PLUS_VID or
# DEV_PLUS_VID_NO_PAD options to have different VLANs with same ID value, on
# different interfaces, please note that you need to use both the interface and
# vlan number in the numbering. This applies for all of the options: name,
# txqueuelen, mac, broadcast, mtu, ingress, egress, flags
#vlan1_name="vlan1"
#eth0_vlan2_name="eth0.2"
#eth1_vlan2_name="eth1.2"

# The following shows the old set_name_type setting and what new option to set:
# Using eth9 & VLAN VID 26 as an example.
# VLAN_PLUS_VID vlan26_name="vlan0026"
# VLAN_PLUS_VID_NO_PAD vlan26_name="vlan26"
# DEV_PLUS_VID eth9_vlan26_name="eth9.0026"
# DEV_PLUS_VID_NO_PAD eth9_vlan26_name="eth9.26"

# Set the vlan flags
#vlan1_flags="reorder_hdr off gvrp on loose_binding on"
#eth0_vlan1_flags="reorder_hdr off gvrp on loose_binding on"

# Configure in/egress maps
#vlan1_ingress="2:6 3:5"
#eth0_vlan1_egress="1:2"

#config_vlan1="172.16.2.1/24"
#config_vlan2="172.16.3.1/24"
#config_eth0_1="172.16.4.1/24"
#config_eth1_1="172.16.5.1/24"

# NOTE: Vlans can be configured with a . in their interface names
# When configuring vlans with this name type, you need to replace . with a _
#config_eth0.1="dhcp" - does not work
#config_eth0_1="dhcp" - does work

# NOTE: Vlans are controlled by their physical interface and not per vlan
# This means you do not need to create init scripts in /etc/init.d for each
# vlan, you must need to create one for the physical interface.
# If you wish to control the configuration of each vlan through a separate
# script then you need to do this.
#vlan_start_eth0="no"

# If you do the above then you may want to depend on eth0 like so
# rc_net_vlan1_need="net.eth0"
# NOTE: depend functions only work in /etc/conf.d/net
# and not in profile configs such as /etc/conf.d/net.foo

# Also, you might want to make eth0 not provide net in this case so that
# dependent services will start when the vlan is active instead of the
# physical interface.
# rc_net_eth0_provide="!net"

# MAC-VLAN support
# The following configuration can be used to create a new interface 'macvlan0'
# linked to 'eth0'
#macvlan_macvlan0="eth0"

# MAC-VLAN mode (private, vepa, bridge, passtru)
#mode_macvlan0="private"

# IP address, MAC address, ... are configured as a normal interface
#config_macvlan0="192.168.20.20/24"
#mac_macvlan0="00:50:06:20:20:20"
comes from /usr/share/doc/netifrc-0.2.2/ net.example.bz2 , 0.2.2 may be different for you
the third from last post in https://forums.gentoo.org/viewtopic-t-898784-start-0.html provides apparent good example and practical discussion.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
russK
l33t
l33t


Joined: 27 Jun 2006
Posts: 630

PostPosted: Sat Jul 26, 2014 7:05 pm    Post subject: Reply with quote

DONAHUE wrote:
Quote:
vim /etc/config.d/net
Is this a typo here only?

Yes that's a typo. It's /etc/conf.d/net

https://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4&chap=3#doc_chap1
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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