LaFonera 2 Networks w. 1 Port

From DD-WRT Wiki

Jump to: navigation, search



This one is 1one1 taken from http://www.dd-wrt.com/forum/viewtopic.php?t=38087. Feel free to add and modify!


I will post these simple steps, for the ones interested or eventually interested in the future. As you all know, knowledge is power so let this continu be a knowledgebase Smile

It striked my mind, the Fonera has one single ethernet port, so mostly its used as AP connected to Internet, and clients on WLAN. I know there is a newer version, with two ports, one for WAN and one for a client/switch with several clients.

However, in my special case I needed to be able to monitor the traffic going through the Fonera with SNMP. No issues at all, SNMP works, but the traffic isnt registered. I quickly discovered the way SNMP works (atleast in DD-WRT, dont know in general), and that means that SNMP will only show traffic counters on interfaces if the traffic going through is routed (one network to another, ie subnet to subnet or to internet and back) or if the traffic are coming from anther interface, ie ath0 (WLAN) in at eth0 (LAN). In this case it even doesnt matter if ath0 and eth0 is bridged in br0, it still shows.

So, interface to interface and network to network, is the keys which will show in SNMP.

In my case, I have a remote site with a Dlink standard router connected to the Internet (no static routes or other features unfortunately) and a Fonera connected by ethernet to the Dlink. The Fonera is in bridged mode, that is WAN disabled so the ethernet port is just a bridge and the Fonera is a part of the Dlink subnet. The Fonera is mainly acting as PPTP endpoint from my network to this remote site,so for the clients at the remote D-Link to have access to this PPTP tunnel (remember D-link has not static routes feature) I needed to change the clients gateway from the D-Link, to the Fonera, and in turn give the Fonera the D-Link as default gateway.

This is a work around, the clients internet traffic goes in at the Fonera ethernet port, then out again to the D-Link. But this makes it possible for the remote site clients to access my network over here (PPTP tunnel) and also make use of DNS on the Fonera for that LAN (D-Link dont do this either).

This all have worked as expected a long time now, but, the fact is as I said I discovered that real traffic from the clients at the remote site going thrpugh the Fonera isnt recorded in SNMP graphs! Probably,because no routing is ever done on the Fonera when local clients access the Internet over there.

The traffic flows from a client, ie 10.10.10.4, to the Fonera ethernet port (br0) 10.10.10.10, and further on leaving the Fonera ethernet port towards the main internet router (D-link) 10.10.10.1. All traffic going in and out is on br0, and in the same subnet. Resulting in SNMP not beeing aware of the actual traffic flow going on.

Never the less, i guess above explanation is enough and als needed for the point of these instructions.

So, what I did was creating a new virtual ethernet interface (no VLAN) during boot up, br0:1. As you all know, br0:0 is already existing as default as a fallback interface in DD-WRT. So I gave this new, br0:1, IP 10.10.2.1 subnet /24. Remember, the Fonera LAN IP (br0) is 10.10.10.10 subnet /24. On the clients, i just changed from 10.10.10.0 network to 10.10.2.0 and setup their default gateway to 10.10.2.1 (Fonera ethernet, br0:1).

And now, all traffic are actually routed, from ie client 10.10.2.4 to Fonera gateway 10.10.2.1, out again on the same port to Dlink internet 10.10.10.1. SNMP records nicely! Smile

Here are the commands for startup:

ifconfig br0:1 IP netmask SUBNET

As simple as that Smile

The downside, which i have noticed, is that it looks like i can give up on DHCP, cause two DHCP instances on one interface wont work. Even if its virtual, i guess the br0 DHCP will interfere if i try to setup a DHCP instance on br0:1 (if even possible on a virtual ethernet interface?) but i will try and see.

Please, if there are any thoughts, ideas or comments feel free to share Smile