Re: vlan interface does not repond on untagged packets

From: Gyrd Thane Lange <gyrd-se_at_thanelange.no>
Date: Thu, 14 Mar 2013 20:06:26 +0100
On 14.03.2013 15:05, Yasir hussan wrote:
> Hi,
> 
> i am creating and testing vlan using these commands,
> 
> *ifconfig arge0 192.168.100.10 netmask 255.255.255.0*
> *
> *
> *ifconfig vlan4 create*
> *ifconfig vlan4 vlandev arge0 vlan 4*
> *ifconfig vlan4 192.168.1.10 netmask 255.255.255.0*
> 
> here arge0 is the default interface of my ethernet device,

This looks about right, you can test it locally on the FreeBSD machine with:

freebsd# ifconfig vlan4
vlan4: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=3<RXCSUM,TXCSUM>
        ether 50:e5:49:5f:1f:89
        inet 192.168.1.10 netmask 0xffffff00 broadcast 192.168.1.255
        inet6 fe80::52e5:49ff:fe5f:1f89%vlan4 prefixlen 64 scopeid 0x8
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
        vlan: 4 parent interface: re0

freebsd# ping 192.168.1.10
(you should receive a lot of replies from yourself)

> now i want to access vlan4 interface from an other pc which has linux and
> is dirctly connected to my freebsd machine, now if i try to ping linux
> machine it will send tagged packets but linux does not recogniz it and
> leave it, and similarly when i try to ping linux machine to vlan4 interface
> on freebsd, linux send untagged packets so vlan4 does not response to it.

Unless you have set up vlan interfaces on the Linux machine then this is
to be expected.

Using instructions from:
https://wiki.archlinux.org/index.php/VLAN

linux# ip link add link eth0 name eth0.4 type vlan id 4
linux# ip addr add 192.168.1.20/24 brd 192.168.1.255 dev eth0.4
linux# ip link set dev eth0.4 up

Note: if you have udev running it will override your "eth0.4" name, and
call it something else. After the first command:

linux# ip link show
(Will give a list. You should probably find something like "eth.4_at_eth0"
near the end. Continue the rest of the commands with whatever part of
the name before the "_at_". I.e. strip away the "_at_eth0" at end.)

Use ifconfig and ping locally to verify that you have the vlan setup.

You should now be able to reach both of the machines from each other.
Assuming they are connected to the same network switch.

> I want that my vlan4 interface could able to recongnize untagged packets
> and could respond to it

Now this is an entirely new and important requirement!

I have read your previous threads, and still don't understand your
networking requirement.
<http://lists.freebsd.org/pipermail/freebsd-current/2013-March/040444.html>

For a vlan to work, tagging all the packets are essential. All the
machines, including all the clients must also have the same vlan
configured for it to work. It will *not work* otherwise.

What exactly is your requirement?
Could you please tell us *why* the other machines are unable to use the
primary IP address (192.168.100.10) assigned to the arge0 interface?

Once we have a better grasp of the situation we will be able to better
guide you.


Best regards,
Gyrd ^_^

> 
> Thanks
Received on Thu Mar 14 2013 - 18:06:39 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:35 UTC