Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Jun 2002 17:27:57 +0200
From:      Christophe Prevotaux <c.prevotaux@hexanet.fr>
To:        "Vladimir B. " Grebenschikov <vova@sw.ru>
Cc:        net@freebsd.org
Subject:   Re: [HELP] IPless VLAN interfaces
Message-ID:  <20020607172757.4f37c70c.c.prevotaux@hexanet.fr>
In-Reply-To: <1023376206.470.40.camel@vbook.express.ru>
References:  <20020606125126.3d44145c.c.prevotaux@hexanet.fr> <1023373804.470.20.camel@vbook.express.ru> <3CFF7644.F4F5CC1@tel.fer.hr> <1023376206.470.40.camel@vbook.express.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
try to setup this (it won't work) your example does not work

ifconfig fxp0 inet 192.168.1.1/24 up
ifconfig fxp0 inet 192.168.1.1/32 alias 
ifconfig fxp0 inet 192.168.1.1/32 alias <--- here it will not work anymore


this is the same thing with vlan interfaces under FreeBSD
you can't have more than 1 interface with the same IP/NETMASK

ifconfig fxp0 inet 192.168.1.1/24 up
ifconfig create vlan0 inet vlan 1 vlandev fxp0 192.168.1.1/32 up
ifconfig create vlan1 inet vlan 2 vlandev fxp0 192.168.1.1/32 up <-- this does not work

let's say for the example sake , that you want only to have 1 vlan on the fxp0
then you can setup the interface as shown above but you can't route anything thru it

route add 192.168.1.2 -interface vlan0 

will not route properly the packets thru vlan0 either because it is a /32 (AFAIK)

and even if you could do it , then the problem is that you are limited to having
only one vlan per interface, which sucks BIG TIME.

under Linux you can have the equivalent of the following setup:

192.168.1.2/24
192.168.1.3/24
192.168.1.4/24

are machines behind the switch vlan 1 2 3 ports respectively

ifconfig fxp0 inet 192.168.1.1/24 up
ifconfig create vlan0 inet vlan 1 vlandev fxp0 192.168.1.1/24 up
ifconfig create vlan1 inet vlan 2 vlandev fxp0 192.168.1.1/24 up
ifconfig create vlan2 inet vlan 3 vlandev fxp0 192.168.1.1/24 up

etc... etc...

and then you do the equivalent of 

route add 192.168.1.2 -interface vlan0 
route add 192.168.1.3 -interface vlan1 
route add 192.168.1.4 -interface vlan2 

and it works just fine, with no problems whatsoever.

What I want to do is just this but under FreeBSD.

My question is : How can I do it ? 


On 06 Jun 2002 19:10:06 +0400
"Vladimir B. " Grebenschikov <vova@sw.ru> wrote:

> ÷ Thu, 06.06.2002, × 18:48, Marko Zec ÎÁÐÉÓÁÌ:
> 
> > > # ifconfig fxp0 1.1.1.1/24
> > > # ifconfig vlan0 1.1.1.1/32
> > > # ifconfig vlan1 1.1.1.1/32
> > > # ifconfig vlan2 1.1.1.1/32
> > 
> > This will never work - you can't have the same IP address/mask on more than
> > one interface.
> 
> Sure ? Do have try cut and paste my example into xterm ?
> 
> vbook#/sys/i386/compile/VBOOK 142_> ifconfig -a
> lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
>         inet 127.0.0.1 netmask 0xff000000 
> fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>         inet 192.168.1.111 netmask 0xffffff00 broadcast 192.168.1.255
>         ether 08:00:46:04:31:b3
>         media: Ethernet autoselect (100baseTX)
>         status: active
> vbook#/sys/i386/compile/VBOOK 143_> ifconfig lo0 1.1.1.1/32 alias
> vbook#/sys/i386/compile/VBOOK 144_> ifconfig fxp0 1.1.1.1/32 alias
> vbook#/sys/i386/compile/VBOOK 145_> uname -a
> FreeBSD vbook.express.ru 5.0-CURRENT FreeBSD 5.0-CURRENT #3: Fri May 24
> 15:49:21 MSD 2002    
> root@vbook.express.ru:/usr/obj/usr/local/src/sys/VBOOK  i386
> vbook#/sys/i386/compile/VBOOK 147_> ifconfig -a
> lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
>         inet 127.0.0.1 netmask 0xff000000 
>         inet 1.1.1.1 netmask 0xffffffff 
> fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>         inet 192.168.1.111 netmask 0xffffff00 broadcast 192.168.1.255
>         inet 1.1.1.1 netmask 0xffffffff broadcast 1.1.1.1
>         ether 08:00:46:04:31:b3
>         media: Ethernet autoselect (100baseTX)
>         status: active
> 
> Both addresses are work:
> 
> vbook#/sys/i386/compile/VBOOK 153_> ping -R -S 1.1.1.1 127.0.0.1
> PING 127.0.0.1 (127.0.0.1) from 1.1.1.1: 56 data bytes
> 64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.167 ms
> RR:     localhost (127.0.0.1)
>         1.1.1.1
> 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.150 ms        (same
> route)
> vbook#/sys/i386/compile/VBOOK 154_> ping -n -R -S 1.1.1.1 192.168.1.109
> PING 192.168.1.109 (192.168.1.109) from 1.1.1.1: 56 data bytes
> 64 bytes from 192.168.1.109: icmp_seq=0 ttl=64 time=1.836 ms
> RR:     192.168.1.109
>         1.1.1.1
> 64 bytes from 192.168.1.109: icmp_seq=1 ttl=64 time=1.600 ms    (same
> route)
> 
> (use loopback not best way to do this, but you can try any interface)
> 
> > What OS are you running?
> 
> # uname -a
> FreeBSD vbook.express.ru 5.0-CURRENT FreeBSD 5.0-CURRENT #3: Fri May 24
> 15:49:21 MSD 2002    
> root@vbook.express.ru:/usr/obj/usr/local/src/sys/VBOOK  i386
> 
> Same setup works well on 4-STABLE
> 
>  
> > Marko
> > 
> -- 
> Vladimir B. Grebenschikov
> vova@sw.ru, SWsoft, Inc.
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-net" in the body of the message
> 


--
===============================================================
Christophe Prevotaux      Email: c.prevotaux@hexanet.fr
HEXANET SARL                URL: http://www.hexanet.fr/
Z.A.C Les Charmilles        Tel: +33 (0)3 26 79 30 05 
3 Allée Thierry Sabine   Direct: +33 (0)3 26 61 77 72 
BP202                       Fax: +33 (0)3 26 79 30 06
51686 Reims Cedex 2 		                   
FRANCE                   HEXANET Network Operation Center             
===============================================================

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020607172757.4f37c70c.c.prevotaux>