1

I'm new at vlan implementation.

I'm trying to manually configure a vlan on my target device. I use these 2 vlan config commands, then I ping an IP address and sniff the packets to look for the vlan tag in the messages.

vconfig add esw0
ifconfig esw0.10 10.93.1.2 netmask 255.255.255.0 

Despite my attempts tagging does not occur in any outgoing packets.

However when I tried the exact same method and commands on my Ubuntu workstation vlan tagging did work without problems.

Target: mips32, Linux 2.6.39, 802.1Q driver version 1.8

Appreciate your help in advance.

Here is a log of what I did:

# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.93.1.1       0.0.0.0         UG    0      0        0 esw0
10.93.1.0       *               255.255.255.0   U     0      0        0 esw0
127.0.0.0       *               255.0.0.0       U     0      0        0 lo
#
#
# vconfig add esw0 10
esw0.10: Features changed: 0x00005800 -> 0x00005000
# ifconfig esw0.10 10.93.1.2 netmask 255.255.255.0
# ifconfig -a
esw0      Link encap:Ethernet  HWaddr 00:01:02:03:04:14  
          inet addr:10.93.1.2  Bcast:10.93.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1509 errors:0 dropped:646 overruns:0 frame:0
          TX packets:21 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:170634 (166.6 KiB)  TX bytes:2542 (2.4 KiB)

esw0.10   Link encap:Ethernet  HWaddr 00:01:02:03:04:14
          inet addr:10.93.1.2  Bcast:10.93.1.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:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:308 (308.0 B)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

# ping 10.93.1.4
PING 10.93.1.4 (10.93.1.4): 56 data bytes
64 bytes from 10.93.1.4: icmp_seq=0 ttl=64 time=9.4 ms
64 bytes from 10.93.1.4: icmp_seq=1 ttl=64 time=0.6 ms
64 bytes from 10.93.1.4: icmp_seq=2 ttl=64 time=0.6 ms
64 bytes from 10.93.1.4: icmp_seq=3 ttl=64 time=0.5 ms
64 bytes from 10.93.1.4: icmp_seq=4 ttl=64 time=0.6 ms
64 bytes from 10.93.1.4: icmp_seq=5 ttl=64 time=0.6 ms
64 bytes from 10.93.1.4: icmp_seq=6 ttl=64 time=0.6 ms
64 bytes from 10.93.1.4: icmp_seq=7 ttl=64 time=0.6 ms
64 bytes from 10.93.1.4: icmp_seq=8 ttl=64 time=0.5 ms
64 bytes from 10.93.1.4: icmp_seq=9 ttl=64 time=0.6 ms
64 bytes from 10.93.1.4: icmp_seq=10 ttl=64 time=0.6 ms
64 bytes from 10.93.1.4: icmp_seq=11 ttl=64 time=0.6 ms
64 bytes from 10.93.1.4: icmp_seq=12 ttl=64 time=0.6 ms
^C
--- 10.93.1.4 ping statistics ---
13 packets transmitted, 13 packets received, 0% packet loss
round-trip min/avg/max = 0.5/1.2/9.4 ms

Nevertheless the esw0.10 vlan interface does seem to be transmitting the ping packets despite not adding the vlan tag.

# cat /proc/net/vlan/esw0.10
esw0.10  VID: 10         REORDER_HDR: 1  dev->priv_flags: 1
         total frames received            0
          total bytes received            0
      Broadcast/Multicast Rcvd            0

      total frames transmitted            6
       total bytes transmitted          468
Device: esw0
INGRESS priority mappings: 0:0  1:0  2:0  3:0  4:0  5:0  6:0 7:0
 EGRESS priority mappings:

Here's a snapshot of the routing table after vlan configuration:

# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use  Iface
default         10.93.1.1       0.0.0.0         UG    0      0        0 esw0
10.93.1.0       *               255.255.255.0   U     0      0        0 esw0
10.93.1.0       *               255.255.255.0   U     0      0        0 esw0.10
127.0.0.0       *               255.0.0.0       U     0      0        0 lo
#

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.