LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-18-2017, 06:34 AM   #1
is2014
LQ Newbie
 
Registered: May 2017
Posts: 5

Rep: Reputation: Disabled
sending vlan tagged packets from ethernet port


Here is my scenario
Quote:
Let's call it desktop
$ cat /etc/fedora-release
Fedora release 17 (Beefy Miracle)
$ uname -a
Linux CSG.localdomain 3.9.10-100.fc17.x86_64 #1 SMP Sun Jul 14 01:31:27 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
# ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 1893 bytes 167138 (163.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1893 bytes 167138 (163.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

p5p1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.200 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::6e3b:e5ff:fe22:a919 prefixlen 64 scopeid 0x20<link>
ether 6c:3b:e5:22:a9:19 txqueuelen 1000 (Ethernet)
RX packets 474455038 bytes 718168282851 (668.8 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 28413363 bytes 1875851521 (1.7 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:a5:a7:9a txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
I want to send packets on ethernet port having vlan tag 1600.
At the other end is a switch having gateway 172.16.116.1 and accepting vlan tagged packets.
I tried
Quote:
# modprobe 8021q
# vconfig add p5p1 1600
Added VLAN with VID == 1600 to IF - : p5p1:-
# ifconfig p5p1.1600 172.16.116.2
# route -n
Quote:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 p5p1
172.16.0.0 0.0.0.0 255.255.0.0 U 0 0 0 p5p1.1600
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 p5p1
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
# ping -I p5p1.1600 172.16.116.1
PING 172.16.116.1 (172.16.116.1) from 172.16.116.2 p5p1.1600: 56(84) bytes of data.
From 172.16.116.2 icmp_seq=1 Destination Host Unreachable
From 172.16.116.2 icmp_seq=2 Destination Host Unreachable
From 172.16.116.2 icmp_seq=3 Destination Host Unreachable
From 172.16.116.2 icmp_seq=4 Destination Host Unreachable
^C
I connected ethernet cable (end fed to switch) to another laptop running wireshark and saw that there were arp broadcast packets 'who has 192.168.1.1 ? tell 192.168.1.200' from mac 6c:3b:e5:22:a9:19
So , it seems that my desktop is not sending vlan tagged packets as the default gateway is associated with p5p1 instead of p5p1.1600.

BTW , I gave 192.x.x.x IP to p5p1 in hope that if destination ip is 172.16.x.x , that interface p5p1 won't be used.
Could be that p5p1.1600 is a sub-interface of p5p1 , so I also tried above with static IP 172.16.116.3 to p5p1 , still no success in pinging 172.16.116.1 .

How can I solve this ?
Please , let me know if any further details are required.
Thanks.

PS: If you have 2 linux PC's , one having wireshark then connect them together and verify that whether other is sending vlan tagged packets.That will be so useful to me.

Last edited by is2014; 05-18-2017 at 06:55 AM. Reason: comment at end for practical check
 
Old 05-23-2017, 10:04 AM   #2
is2014
LQ Newbie
 
Registered: May 2017
Posts: 5

Original Poster
Rep: Reputation: Disabled
to moderator ,
Can you move this thread to software forum .
Guess , i will find replies there.

Thanks.
 
  


Reply

Tags
network interface, packet, vlan


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 - Tagged and native vlan cosmoarg Linux - Networking 1 01-24-2017 02:33 PM
Sending ethernet packet with VLAN tag in C socket Praju26 Linux - Networking 9 07-01-2015 06:34 PM
how configure bridge in linux for sending packets from access point to ethernet vlan dkpradhan Linux - Wireless Networking 1 11-27-2013 12:43 AM
One dedicated vlan port and one tagged port, share IP? jeriryan Linux - Networking 2 02-11-2011 06:24 PM
VLAN Tagged IP Packets in Linux sudheendrasp Linux - Newbie 0 07-29-2010 09:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:45 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