turning wan and lan into a switch on a Fon+

General discussion about Gargoyle, OpenWrt or anything else even remotely related to the project

Moderator: Moderators

Post Reply
digininja
Posts: 4
Joined: Tue Dec 02, 2008 6:24 pm

turning wan and lan into a switch on a Fon+

Post by digininja »

On a Fon+, can anyone tell me how to turn the two wired ports into a switch rather than being two devices?

I assumed it would be as easy as just bridging eth0.0 and eth0.1 but doing that the device is letting stuff go out from the lan to wan port but not back agin.

I've completely disabled iptables so that isn't interfering.

Eric
Site Admin
Posts: 1443
Joined: Sat Jun 14, 2008 1:14 pm

Re: turning wan and lan into a switch on a Fon+

Post by Eric »

Have you made sure that the source & destination IPs you are pinging to/from are on the same subnet?

digininja
Posts: 4
Joined: Tue Dec 02, 2008 6:24 pm

Re: turning wan and lan into a switch on a Fon+

Post by digininja »

ye, source is 192.168.1.2 dst is 192.168.1.3. It shouldn't matter but the Fon is 192.168.1.1.

Watching traffic with tcpdump, if I ping from the machine on the lan side to the wan side the traffic does flow but if I ping back the traffic stops at the fon. But, if I generate traffic from the lan to the fon while trying to ping from the wan to the lan some packets do get through. I know it should be an all or nothing but if I get a wan to lan ping going then ssh fro the lan to the fon and type the ping traffic will flow, if I stop then the flow stops.

Any ideas?

Eric
Site Admin
Posts: 1443
Joined: Sat Jun 14, 2008 1:14 pm

Re: turning wan and lan into a switch on a Fon+

Post by Eric »

What output do you get if you run brctl showmacs br-lan (assuming your bridge is named br-lan) ? Do you see the MAC addresses of both interfaces on your router as well as the two computers you are trying to get to ping each other?

digininja
Posts: 4
Joined: Tue Dec 02, 2008 6:24 pm

Re: turning wan and lan into a switch on a Fon+

Post by digininja »

I get the macs of all 3 devices, wan, lan and the Fon.

On the wan side, arp -a gives me the mac of the other two devices, on the lan side I get the mac of the Fon but for the wan side I get <incomplete>.

Something I've thought it could be, what should I have in my /etc/config/network file? At the moment it looks like this and when I start it up I ssh in, drop the ip on wan to 0.0.0.0 and add it to the br-lan bridge.

Code: Select all

config 'interface' 'loopback'
        option 'ifname' 'lo'
        option 'proto' 'static'
        option 'ipaddr' '127.0.0.1'
        option 'netmask' '255.0.0.0'
        
config 'interface' 'wifi'
        option 'ipaddr' '172.16.1.1'
        option 'netmask' '255.255.255.0'
        option 'proto' 'static'

config 'interface' 'lan'
        option 'type' 'bridge'
        option 'ifname' 'eth0.0' 'eth0.1'
        option 'proto' 'static'
        option 'ipaddr' '192.168.1.1'
        option 'netmask' '255.255.255.0'
        option 'dns' '192.168.1.1 '

config 'interface' 'wan'
        option 'ifname' 'eth0.1'
        option 'proto' 'static'
        option 'ipaddr' '10.1.1.1'
        option 'netmask' '255.255.255.0'

Eric
Site Admin
Posts: 1443
Joined: Sat Jun 14, 2008 1:14 pm

Re: turning wan and lan into a switch on a Fon+

Post by Eric »

Try removing (or commenting out) the wan section of your /etc/config/network file. Then restart the network (/etc/init.d/network restart). The bridge should be created automatically when you restart the network, you shouldn't need to do it manually.

If that still doesn't work try setting the ip of your wan interface to another address on the same subnet.

digininja
Posts: 4
Joined: Tue Dec 02, 2008 6:24 pm

Re: turning wan and lan into a switch on a Fon+

Post by digininja »

I've already tried removing the wan interface, if I do then I don't get an eth0.1, just a single eth0 which is the lan interface.

I haven't tried setting the ip on boot to be on the same subnet but I do it by hand once it has booted. I'll try setting it in the script and see if it makes any difference.

Post Reply