LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   sending vlan tagged packets from ethernet port (https://www.linuxquestions.org/questions/linux-newbie-8/sending-vlan-tagged-packets-from-ethernet-port-4175606202/)

is2014 05-18-2017 06:34 AM

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.

is2014 05-23-2017 10:04 AM

to moderator ,
Can you move this thread to software forum .
Guess , i will find replies there.

Thanks.


All times are GMT -5. The time now is 01:25 PM.