When configuring 2 VLANs to be on the same subnet, only one works.

Eygene Ryabinkin rea-fbsd at codelabs.ru
Tue Jan 13 06:09:54 PST 2009


EItan, good day.

Tue, Jan 13, 2009 at 03:09:11PM +0200, Eitan Shefi wrote:
> I use 2 directly connected FreeBSD-7.0 hosts.
> When I create 2 VLANs for the same interface (mtnic0), on each host, and
> configure the VLANs on each host to be on the same subnet:
> ping works only to one of the VLANs.
>  
> I run:
> On sw259: 
> /sbin/ifconfig vlan1 create vlan 1 vlandev mtnic0
> /sbin/ifconfig vlan2 create vlan 2 vlandev mtnic0
> /sbin/ifconfig vlan1 91.154.12.5 netmask 255.0.0.0
> /sbin/ifconfig vlan2 91.155.12.5 netmask 255.0.0.0
>  
> On sw260: 
> /sbin/ifconfig vlan1 create vlan 1 vlandev mtnic0
> /sbin/ifconfig vlan2 create vlan 2 vlandev mtnic0
> /sbin/ifconfig vlan1 91.154.12.6 netmask 255.0.0.0
> /sbin/ifconfig vlan2 91.155.12.6 netmask 255.0.0.0
>  
> Now on sw259 run: 
> ping 91.154.12.6 - works. 
> ping 91.155.12.6 - does not work. 

You're running two interfaces on the same /8 subnet at one host.  I bet
that your routing table specifies that packets both for 91.154.12.6 and
91.155.12.6 should go through the same interface, probably vlan1.  Could
you show output of 'netstat -rn', 'route get 91.154.12.6' and 'route get
91.155.12.6'?

Also try to spawn tcpdump on the interface that packets for 91.154.12.6
are routed to and look for the captured packets when pinging
91.155.12.6.  Your local firewall could also prevent packets from being
pushed to the network, but this actually depens on your configuration.
-- 
Eygene
 _                ___       _.--.   #
 \`.|\..----...-'`   `-._.-'_.-'`   #  Remember that it is hard
 /  ' `         ,       __.--'      #  to read the on-line manual
 )/' _/     \   `-_,   /            #  while single-stepping the kernel.
 `-'" `"\_  ,_.-;_.-\_ ',  fsc/as   #
     _.-'_./   {_.'   ; /           #    -- FreeBSD Developers handbook
    {_.-``-'         {_/            #


More information about the freebsd-net mailing list