LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-24-2017, 02:44 PM   #1
hossammutir
LQ Newbie
 
Registered: Sep 2016
Posts: 2

Rep: Reputation: Disabled
How to Centos multi VLAN tagging one network port ?


hello
I'm trying to use two VLANs (VLAN 43 & VLAN 44) in same eth card in linux Centos 7 and Cisco switch trunk for the eth port.

My configuration is:
Quote:
[root@rdo1 network-scripts]# cat ifcfg-eth2
TYPE=Ethernet
DEFROUTE=no
NAME=eth2
DEVICE=eth2
ONBOOT=yes
IPV6INIT=no
NM_CONTROLLED=no
Quote:
[root@rdo1 network-scripts]# cat ifcfg-eth2.43
VLAN=yes
VLAN_NAME_TYPE=VLAN_PLUS_VID_NO_PAD
PHYSDEV=eth2
DEVICE=eth2.43
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.13.43.24
NETMASK=255.255.255.0
Quote:
[root@rdo1 network-scripts]# cat ifcfg-eth2.44
VLAN=yes
VLAN_NAME_TYPE=VLAN_PLUS_VID_NO_PAD
PHYSDEV=eth2
DEVICE=eth2.44
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.13.44.24
NETMASK=255.255.255.0
Cisco configuration:

Quote:
vlan 43-44

!
int gi3/1
no ip address
switchport
switchport trunk encapsulation dot1q
switchport trunk allowed vlan 43,44
switchport mode trunk
no mdix auto
storm-control broadcast level 10.00
spanning-tree bpdufilter enable
no cdp enable
!
end
My network configuration according to ifconfig is:

Quote:
[root@rdo1 network-scripts]# ifconfig
eth2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::29c:2ff:fea1:35a4 prefixlen 64 scopeid 0x20<link>
ether 00:9c:02:a1:35:a4 txqueuelen 1000 (Ethernet)
RX packets 164 bytes 17921 (17.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 29 bytes 2424 (2.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth2.43: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.13.43.24 netmask 255.255.255.0 broadcast 10.13.43.255
inet6 fe80::29c:2ff:fea1:35a4 prefixlen 64 scopeid 0x20<link>
ether 00:9c:02:a1:35:a4 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 9 bytes 690 (690.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth2.44: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.13.44.24 netmask 255.255.255.0 broadcast 10.13.44.255
inet6 fe80::29c:2ff:fea1:35a4 prefixlen 64 scopeid 0x20<link>
ether 00:9c:02:a1:35:a4 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12 bytes 816 (816.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
I want to know how to add gateway for every VLAN. I tried routing tables and they didn't work for me.

Does anyone know how to do this?
 
Old 02-04-2017, 08:17 AM   #2
netguy2000
Member
 
Registered: Oct 2003
Location: Karachi, PAKISTAN
Distribution: Redhat, Fedora, Open BSD, FreeBSD, SlackWare
Posts: 115

Rep: Reputation: 15
hi there,
please use GATEWAY=xxx.xxx.xxx.xxx to add gateway for each interface in each file,
by the way why you want to add gateway for each interface, your config looks like you are try to configure gateway machine for users. or........ plz explain.

netguy.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
VLAN. How to check the tagging? orrik Linux - Networking 1 05-11-2016 10:40 AM
Vlan tagging through a bridge to a VM hosselausso Linux - Networking 1 02-18-2015 09:19 AM
vlan tagging dhcpd.conf for second subnet in centos rootaccess Linux - Networking 5 02-01-2014 05:48 AM
802.1Q vlan tagging help td3201 Linux - Networking 1 09-23-2009 06:39 PM
FreeBSD - need help making vlan for multi-port trunk.. BrianK *BSD 1 06-13-2006 01:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration