Добрый день. Стоит задача получать на сервере данные с клиентов из разных vlan. Сервер одним шнурком воткнут в коммутатор. Покурил форум, была такая задача. Настроил vlan на сервере (пока 1):
eth0 Link encap:Ethernet HWaddr 00:15:5d:07:53:14
inet addr:10.22.64.77 Bcast:10.22.71.255 Mask:255.255.248.0
inet6 addr: fe80::215:5dff:fe07:5314/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:29383965 errors:0 dropped:159081 overruns:0 frame:0
TX packets:33466140 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2493293542 (2.4 GB) TX bytes:2877753481 (2.8 GB)
eth0.3 Link encap:Ethernet HWaddr 00:15:5d:07:53:14
inet addr:10.21.64.3 Bcast:10.21.64.255 Mask:255.255.255.0
inet6 addr: fe80::215:5dff:fe07:5314/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:740 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:31392 (31.3 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:11610288 errors:0 dropped:0 overruns:0 frame:0
TX packets:11610288 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1186006896 (1.1 GB) TX bytes:1186006896 (1.1 GB)
root@node1:~# cat /proc/net/vlan/eth0.3
eth0.3 VID: 3 REORDER_HDR: 1 dev->priv_flags: 1
total frames received 0
total bytes received 0
Broadcast/Multicast Rcvd 0
total frames transmitted 740
total bytes transmitted 31392
Device: eth0
INGRESS priority mappings: 0:0 1:0 2:0 3:0 4:0 5:0 6:0 7:0
EGRESS priority mappings:
root@node1:~#
Порт на коммутаторе, в который воткнут сервер является тегированным в 3 vlan. В первом default vlan порт не тегированный и сервер получает/отдает пакеты по нему без проблем.
В третьем vlan пинг не проходит не в одну ни в другую сторону. Маршруты настроены.
root@node1:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.21.64.0 * 255.255.255.0 U 0 0 0 eth0.3
10.21.66.0 10.21.64.254 255.255.254.0 UG 0 0 0 eth0.3
10.21.67.0 10.21.64.254 255.255.255.0 UG 0 0 0 eth0.3
10.22.64.0 * 255.255.248.0 U 0 0 0 eth0
При этом запросы с сервера уходят:
root@node1:~# tcpdump -Uw - | tcpdump -i eth0.3 -en
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0.3, link-type EN10MB (Ethernet), capture size 65535 bytes
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
11:28:55.527849 00:15:5d:07:53:14 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 10.21.64.254 tell 10.21.64.3, length 28
11:28:56.525042 00:15:5d:07:53:14 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 10.21.64.254 tell 10.21.64.3, length 28
11:28:57.524991 00:15:5d:07:53:14 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 10.21.64.254 tell 10.21.64.3, length 28
11:28:58.542279 00:15:5d:07:53:14 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 10.21.64.254 tell 10.21.64.3, length 28
11:28:59.540995 00:15:5d:07:53:14 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 10.21.64.254 tell 10.21.64.3, length 28