problem with vlan interfaces tagging/untagging in a simulated
switch box
h bagade
bagadeh at gmail.com
Mon Mar 5 04:51:06 UTC 2012
if you can not get the image, I've tried to draw text form here with commands:
######################
[system 1]------#--[eth0]---- #
# |-- [hub0]------[vlan2] #
[system 2]------#--[eth2]---- | #
# | #
# [eth1] #
#################|#####
|
netgraph commands are:
ncgtl mkpeer eth0: hub lower lower0
ngctl name eth0:lower hub0
ngctl connect eth2: hub0: lower lower2
ngct mkpeer hub0: vlan vlan2 vlan2
ngctl name hub0:vlan2 vlan2
ngct connect vlan2: eth1: downstream lower
ngctl msg vlan2: addfilter '{vlan=2 hook="vlan2"}'
ifconfig commands:
ifconfig bridge0 create
ifconfig bridge0 addm eth0 addm eth2
On 3/5/12, h bagade <bagadeh at gmail.com> wrote:
> I've tried netgraph nodes too! but stuck on the next step and asked
> the problem on this forum and received no answer:( my netgraph
> scenario is described below:
>
> I have designed a topology(attached) using netgraph to add vlan2
> tag to the frames coming from eth0(vlan port) and send it to
> eth1(trunk port) to go out of the box. it works fine.
>
> Then I tried to add another interface like eth0 which named eth2(vlan
> port) to be
> tagged vlan2 too. After that, I bridged eth0 and eth2 using
> ifconfig(as vlan ports are connected to each other on same vlan id).
> When traffic comes from eth0(system1) to the destination
> eth2(system2), all traffic also sent out eth1 which is not suitable!
>
> In the mentioned scenario, I don't want the traffic pass to the eth1. Is
> there any way that eth1 recognize which mac addresses don't belong to this
> box then sends the traffic out? I mean I want to send taraffic out of eth1
> when the destination is not accessible via FreeBSD box so it should be sent
> out to be find out.
>
> On 3/4/12, rozhuk.im at gmail.com <rozhuk.im at gmail.com> wrote:
>>
>> Use netgraph nodes.
>>
>>
>>> -----Original Message-----
>>> From: owner-freebsd-net at freebsd.org [mailto:owner-freebsd-
>>> net at freebsd.org] On Behalf Of h bagade
>>> Sent: Sunday, March 04, 2012 3:31 PM
>>> To: freebsd-net
>>> Subject: problem with vlan interfaces tagging/untagging in a simulated
>>> switch box
>>>
>>> Hi all,
>>>
>>> I have problems with vlan interfaces on freebsd. I want to make my
>>> system like a switch with vlan ports and also a trunk port in
>>> conjuction with other switches. I thought that vlan interfaces would
>>> help me tagging traffic when traffic is going out the trunk port(or
>>> when it receives on vlan ports).
>>> The problem, I've encountered is that vlan interafaces on freebsd do
>>> tagging/untagging when the traffic is sourced/destined from/to them
>>> which in this case they should be assigned IP addresses. In other words
>>> they won't tag the traffic passing through their parent interface which
>>> I need to.
>>>
>>> In my case to be acting like a switch, interfaces on system won't have
>>> ip addresses and I need to tag the traffic coming from for example
>>> interface1 when passing through interfaceN(acting as trunk port).
>>> How could I reach this? would it be possible to use vlan interfaces to
>>> do so?
>>>
>>> I've tried many many ways to simulate the case but no success achieved!
>>> I'm really interested to find the proper solution for my config.
>>>
>>> Any comments or hints are really apperciated.
>>> _______________________________________________
>>> freebsd-net at freebsd.org mailing list
>>> http://lists.freebsd.org/mailman/listinfo/freebsd-net
>>> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"
>>
>>
>
More information about the freebsd-net
mailing list