Y
Y
yazhog2019-04-24 01:41:42
linux
yazhog, 2019-04-24 01:41:42

Why is VLAN not working in Ubuntu 16.04?

Physically, there are 2 gateways on the local network with Internet access - 192.168.0.1 and 192.168.99.1
In windows 10, everything works fine with similar settings : 4c972-clip-15kb.png?nocache=1
There is a server on Ubuntu 16.04 on the network:

# uname -a
Linux sample.ru 4.4.0-142-generic #168-Ubuntu SMP Wed Jan 16 21:00:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 30:9c:23:5f:64:12  
          inet addr:192.168.0.99  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7565745239 errors:0 dropped:1083 overruns:0 frame:0
          TX packets:11063924472 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2019322503965 (2.0 TB)  TX bytes:12025616246593 (12.0 TB)

I add an alias to it:
#modprobe 8021q //единожды
# vconfig add eth0 5
Added VLAN with VID == 5 to IF -:eth0:-
# ifconfig eth0.5 192.168.99.100 netmask 255.255.255.0 broadcast 192.168.99.255 up
# ifconfig eth0.5
eth0.5    Link encap:Ethernet  HWaddr 30:9c:23:5f:64:12  
          inet addr:192.168.99.100  Bcast:192.168.99.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:30 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:1260 (1.2 KB)
# ip ro
default via 192.168.0.1 dev eth0 
192.168.0.0/24 dev eth0  proto kernel  scope link  src 192.168.0.99 
192.168.99.0/24 dev eth0.5  proto kernel  scope link  src 192.168.99.100

As a result, this VLAN does not work, pings do not go. Not to the gateway, not to other computers on the network. The gateway itself and other computers also do not see this server in the VLAN (by the way, there is another server on the same ubuntu, the story is the same).
# ping 192.168.99.1
PING 192.168.99.1 (192.168.99.1) 56(84) bytes of data.
From 192.168.99.100 icmp_seq=1 Destination Host Unreachable
From 192.168.99.100 icmp_seq=2 Destination Host Unreachable
From 192.168.99.100 icmp_seq=3 Destination Host Unreachable
From 192.168.99.100 icmp_seq=4 Destination Host Unreachable
From 192.168.99.100 icmp_seq=5 Destination Host Unreachable
From 192.168.99.100 icmp_seq=6 Destination Host Unreachable
^C
--- 192.168.99.1 ping statistics ---
7 packets transmitted, 0 received, +6 errors, 100% packet loss, time 6036ms

At the same time, it pings itself perfectly:
# ping 192.168.99.100
PING 192.168.99.100 (192.168.99.100) 56(84) bytes of data.
64 bytes from 192.168.99.100: icmp_seq=1 ttl=64 time=0.025 ms
64 bytes from 192.168.99.100: icmp_seq=2 ttl=64 time=0.015 ms
64 bytes from 192.168.99.100: icmp_seq=3 ttl=64 time=0.014 ms
64 bytes from 192.168.99.100: icmp_seq=4 ttl=64 time=0.013 ms

Where to dig? A week of googling gave me no answers.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2019-04-24
@yazhog

Windows does not support 802.1q (vlan), it seems to me that you have a regular access port there, and you just assign two addresses to the interface, judging by the screenshot. On linux, this is done using the aliases
ifconfig eth0:0 192.168.99.100 netmask 255.255.255.0 up
admin-gu.ru/os/linux/dobavit-dopolnitelnyj-alias-i...

N
Nik, 2019-04-29
@Lastok

Are you sure that you raised vlans on Windows? By default, Windows does not know how to tag traffic.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question