LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 05-11-2016, 01:45 AM   #1
orrik
LQ Newbie
 
Registered: May 2016
Distribution: Centos
Posts: 10

Rep: Reputation: Disabled
VLAN. How to check the tagging?


Hello all
I have problems with the configuration of the VLAN. I configured your network as described below:
https://access.redhat.com/documentat...mand_Line.html
The current configuration looks like this:

Code:
# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPV6INIT=no
Code:
# cat /etc/sysconfig/network-scripts/ifcfg-vlan20
VLAN=yes
VLAN_NAME_TYPE=VLAN_PLUS_VID_NO_PAD
DEVICE=vlan20
PHYSDEV=eth1
BOOTPROTO=static
ONBOOT=yes
HWADDR=00:30:4F:25:75:EA
IPADDR=192.168.2.10
NETMASK=255.255.255.0
NETWORK=192.168.2.0
USERCTL=no
NM_CONTROLLED=no
IPV6INIT=no
ARPCHECK=no
Code:
# cat /etc/sysconfig/network-scripts/ifcfg-vlan30
VLAN=yes
VLAN_NAME_TYPE=VLAN_PLUS_VID_NO_PAD
DEVICE=vlan30
PHYSDEV=eth1
ONBOOT=yes
HWADDR=00:30:4F:25:75:EA
IPADDR=192.168.3.10
NETMASK=255.255.255.0
NETWORK=192.168.3.0
USERCTL=no
NM_CONTROLLED=no
BOOTPROTO=static
IPV6INIT=no
ARPCHECK=no
Code:
# ifconfig
eth0      Link encap:Ethernet  HWaddr 20:CF:30:B6:44:13
          inet addr:192.168.0.249  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6698 errors:0 dropped:0 overruns:0 frame:0
          TX packets:210 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:597891 (583.8 KiB)  TX bytes:23683 (23.1 KiB)

eth1      Link encap:Ethernet  HWaddr 00:30:4F:25:75:EA
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:450 errors:0 dropped:0 overruns:0 frame:0
          TX packets:243 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:50370 (49.1 KiB)  TX bytes:30310 (29.5 KiB)
          Interrupt:19 Base address:0xcc00

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:26 errors:0 dropped:0 overruns:0 frame:0
          TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2912 (2.8 KiB)  TX bytes:2912 (2.8 KiB)

vlan20    Link encap:Ethernet  HWaddr 00:30:4F:25:75:EA
          inet addr:192.168.2.10  Bcast:192.168.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:111 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:13969 (13.6 KiB)

vlan30    Link encap:Ethernet  HWaddr 00:30:4F:25:75:EA
          inet addr:192.168.3.10  Bcast:192.168.3.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:105 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:13717 (13.3 KiB)
Code:
# ip -d link show vlan20
5: vlan20@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
    link/ether 00:30:4f:25:75:ea brd ff:ff:ff:ff:ff:ff
    vlan id 20 <REORDER_HDR>
[root@test ~]# ip -d link show vlan30
6: vlan30@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
    link/ether 00:30:4f:25:75:ea brd ff:ff:ff:ff:ff:ff
    vlan id 30 <REORDER_HDR>
Code:
# ping vlan20
PING vlan20 (192.168.2.10) 56(84) bytes of data.
64 bytes from vlan20 (192.168.2.10): icmp_seq=1 ttl=64 time=0.037 ms
64 bytes from vlan20 (192.168.2.10): icmp_seq=2 ttl=64 time=0.023 ms
^C
--- vlan20 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1741ms
rtt min/avg/max/mdev = 0.023/0.030/0.037/0.007 ms

# ping vlan30
PING vlan30 (192.168.3.10) 56(84) bytes of data.
64 bytes from vlan30 (192.168.3.10): icmp_seq=1 ttl=64 time=0.039 ms
64 bytes from vlan30 (192.168.3.10): icmp_seq=2 ttl=64 time=0.023 ms
^C
--- vlan30 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1298ms
rtt min/avg/max/mdev = 0.023/0.031/0.039/0.008 ms
Code:
# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.3.0     0.0.0.0         255.255.255.0   U     0      0        0 vlan30
192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 vlan20
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1003   0        0 eth1
169.254.0.0     0.0.0.0         255.255.0.0     U     1005   0        0 vlan20
169.254.0.0     0.0.0.0         255.255.0.0     U     1006   0        0 vlan30
0.0.0.0         192.168.0.240   0.0.0.0         UG    0      0        0 eth0

Now I have a question. How to check whether VLAN-s work (tcpdump?)? It I mean (do not know if the word correctly but ...) whether packets are tagged.

I want to build my network on manageable switches (TP-LINK TL-SL2452WEB). From what I read VLAN will not work when packets are untagged.

How to check it?

Regards
orrik
 
Old 05-11-2016, 11:40 AM   #2
tlowk
Member
 
Registered: Nov 2003
Location: Belgium
Distribution: Slackware
Posts: 184

Rep: Reputation: 36
I'm not sure I understand the question but you can use

Quote:
tcpdump -i eth1 vlan 20
or

Quote:
tcpdump -i eth1 vlan 30
you can also check at the ethernet level, it shows the vlan 20 for a packet or vlan 30

Quote:
tcpdump -i eth1 -e
best regards,


Tlowk
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 tagging through a bridge to a VM hosselausso Linux - Networking 1 02-18-2015 10:19 AM
vlan tagging with bonding not reaching gateway pat_33 Linux - Networking 2 01-31-2011 10:25 AM
Lenny Debian VLAN tagging Q Allanon_TB Linux - Networking 1 05-30-2010 09:12 AM
802.1Q vlan tagging help td3201 Linux - Networking 1 09-23-2009 07:39 PM
VLAN Tagging and Cisco 2924XL EN questions metallica1973 Linux - Networking 4 01-29-2008 01:08 PM

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

All times are GMT -5. The time now is 03:52 AM.

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