From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <01f701c63728$6203bef0$4a27b3d5@tungemaskin> From: =?iso-8859-1?Q?J=F8rgen_Hovland?= Date: Tue, 21 Feb 2006 21:50:00 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_01F4_01C63730.C3B78520" Subject: [Bridge] physical interface on a bridge List-Id: Linux Ethernet Bridging List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: bridge@lists.osdl.org This is a multi-part message in MIME format... ------=_NextPart_000_01F4_01C63730.C3B78520 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Is there a way to either: Find the real ifindex/ifname a mac-address is bound to or Find the real ifindex/ifname of an incoming packet ? I am writing a dhcp server and need to know what real interface the dhcp re= quest packet came from. An acceptable solution would be to get the interfac= e by the mac-address, but that can be faked so I would rather get the inter= face by knowing where the data actually came from. Data is IP, UDP broadcas= t. I _could_ use raw sockets. The problem is when I do that, the program is us= ing ~8% cpu on a 3.2ghz xeon64 just reading packets without doing anything = due to the amount of traffic passing through the box (~200mbit and increasi= ng) so that doesn't look like a good idea. brctl showmacs returns a list of port numbers, but they dont make much sens= e to me. They do not seem to be in the same order I added the interfaces? I= s there a mapping here? Example, jorgen@ams41:/$ /tmp/brctl showmacs test0 port no mac addr is local? ageing timer 2 00:04:e2:a8:3b:d7 no 0.24 1 00:08:a1:85:39:fd no 17.31 133 00:0d:88:a3:61:4a no 9.90 1 00:14:22:b0:cd:e0 yes 0.00 133 00:16:c7:f5:8f:e2 no 0.48 Port 133 is the 901'th interface (0x385) I added to bridge test0. What does= 133 point to? The ifindex of this physical interface is 912 (0x390) (retr= ieved with SIOCGIFINDEX). Secondly, I seem to be unable to add more than around 1024 interfaces to a single bri= dge. Is there a way to increase this limit? I am using linux kernel 2.6 Thanks a million, Joergen ------=_NextPart_000_01F4_01C63730.C3B78520 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Hi
 
Is there a way to either:
Find the real ifindex/ifname a mac-address= is bound=20 to
or
Find the real ifindex/ifname of an incomin= g=20 packet
?
 
I am writing a dhcp server and need to kno= w what=20 real interface the dhcp request packet came from. An acceptable solution wo= uld=20 be to get the interface by the mac-address, but that can be faked so I woul= d=20 rather get the interface by knowing where the data actually came from. Data= is=20 IP, UDP broadcast.
I _could_ use raw sockets. The problem is = when I do=20 that, the program is using ~8% cpu on a 3.2ghz xeon64 just reading pac= kets=20 without doing anything due to the amount of traffic passing through the box= =20 (~200mbit and increasing) so that doesn't look like a good=20 idea.
 
brctl showmacs returns a list of port numb= ers, but=20 they dont make much sense to me. They do not seem to be in the same order I= =20 added the interfaces? Is there a mapping here?
 
Example,
jorgen@ams41:/$ /tmp/brctl showmacs=20 test0
port no mac=20 addr            = ;   =20 is local?       ageing timer
 =20 2     00:04:e2:a8:3b:d7     &n= bsp;=20 no            &= nbsp;   =20 0.24
  1    =20 00:08:a1:85:39:fd      =20 no            &= nbsp;  =20 17.31
133    =20 00:0d:88:a3:61:4a      =20 no            &= nbsp;   =20 9.90
  1    =20 00:14:22:b0:cd:e0      =20 yes            =    =20 0.00
133    =20 00:16:c7:f5:8f:e2      =20 no            &= nbsp;   =20 0.48
Port 133 is the 901'th interface (0x385)&n= bsp;I=20 added to bridge test0. What does 133 point to?  The ifindex of this physical interface is 912 (0x390)= =20 (retrieved with SIOCGIFINDEX).
 
Secondly,
I seem to be unable to add more than aroun= d 1024=20 interfaces to a single bridge. Is there a way to increase this=20 limit?
 
I am using linux kernel 2.6
 
 
Thanks a million,
Joergen
------=_NextPart_000_01F4_01C63730.C3B78520--