Skip site navigation (1)Skip section navigation (2)
Date:      10 Jun 2002 12:07:20 +0400
From:      "Vladimir B. " Grebenschikov <vova@sw.ru>
To:        Christophe Prevotaux <c.prevotaux@hexanet.fr>
Cc:        "net@freebsd.org" <net@freebsd.org>
Subject:   Re: [HELP] IPless VLAN interfaces
Message-ID:  <1023696440.576.17.camel@vbook.express.ru>
In-Reply-To: <20020607172757.4f37c70c.c.prevotaux@hexanet.fr>
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>  <20020607172757.4f37c70c.c.prevotaux@hexanet.fr>

next in thread | previous in thread | raw e-mail | index | archive | help
=F7 Fri, 07.06.2002, =D7 19:27, Christophe Prevotaux =CE=C1=D0=C9=D3=C1=CC:
> try to setup this (it won't work) your example does not work

As I already said you need to remove interface route here
(or apply changes sugessted by Iasen Kostoff <tbyte@otel.net>)

> ifconfig fxp0 inet 192.168.1.1/24 up
> ifconfig fxp0 inet 192.168.1.1/32 alias=20
route delete 192.168.1.1
> ifconfig fxp0 inet 192.168.1.1/32 alias <--- here it will not work anymor=
e


With route line it will work

> this is the same thing with vlan interfaces under FreeBSD
> you can't have more than 1 interface with the same IP/NETMASK
>=20
> ifconfig fxp0 inet 192.168.1.1/24 up
> ifconfig create vlan0 inet vlan 1 vlandev fxp0 192.168.1.1/32 up
route delete 192.168.1.1
> ifconfig create vlan1 inet vlan 2 vlandev fxp0 192.168.1.1/32 up <-- this=
 does not work

before each new vlan initialization you need remove interface route=20

> 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 anyth=
ing thru it
>=20
> route add 192.168.1.2 -interface vlan0=20
>=20
> will not route properly the packets thru vlan0 either because it is a /32=
 (AFAIK)

It is not valid command, see:

# route add 1.2.3.4 -interface fxp0
add host 1.2.3.4: gateway fxp0
# netstat -rn | fgrep 1.2.3.4
1.2.3.4            00:00:00:00:00:00  UHLS        0        0   fxp0
#
It is invalid route, -interface command add route direct reachable via
interface (ppp interface for example) but there we have ethernet with
indirect access (you need mac-resolve first)

see:

#  route add -net 1.2.3.4/32 -cloning -iface fxp0
add net 1.2.3.4: gateway fxp0
# netstat -rn | fgrep 1.2.3.4
1.2.3.4/32         link#3             UCS         0        0   fxp0
#

So, it is net-route and it will be cloned at request (arp-request will
be sent)

# ping -c1 1.2.3.4
PING 1.2.3.4 (1.2.3.4): 56 data bytes
64 bytes from 1.2.3.4: icmp_seq=3D0 ttl=3D64 time=3D1.799 ms
--- 1.2.3.4 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev =3D 1.799/1.799/1.799/0.000 ms
# netstat -rn | fgrep 1.2.3.4
1.2.3.4            00:01:03:d6:9e:9f  UHLW        0        2   fxp0 =20
1192 =3D>
1.2.3.4/32         link#3             UCS         1        0   fxp0
#

you see at this stage you have cloning(C) netroute and cloned(W)
hostroute to your NIC with 1.2.3.4

If you do not want arp-resolve you can specify MAC-address (link-layer
address):

# route add -host 4.3.2.1 -link aa:bb:cc:dd:ee:ff -ifp fxp0
add host 4.3.2.1: gateway aa:bb:cc:dd:ee:ff
# netstat -rn | fgrep 4.3.2.1
4.3.2.1            aa:bb.cc.dd.ee.ff  UGHS        0        0   fxp0
#

Ruslan Ermilov <ru@freebsd.org> knows more about routes setup and may be
correct me if I am mistaken.

> 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.

No, see above

> under Linux you can have the equivalent of the following setup:
>=20
> 192.168.1.2/24
> 192.168.1.3/24
> 192.168.1.4/24
>=20
> are machines behind the switch vlan 1 2 3 ports respectively
>=20
> 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
>=20
> etc... etc...
>=20
> and then you do the equivalent of=20
>=20
> route add 192.168.1.2 -interface vlan0=20
> route add 192.168.1.3 -interface vlan1=20
> route add 192.168.1.4 -interface vlan2=20

As I said -interface flag is invalid here, Linux or too smart or too
stupid here.

> and it works just fine, with no problems whatsoever.
>=20
> What I want to do is just this but under FreeBSD.
>=20
> My question is : How can I do it ?=20

See above
=20
PS:=20
  As I already said, route manpage need some work, because it is very
unclean, may be somebody who knows English well will do it ...


--=20
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1023696440.576.17.camel>