OpenWrt Forum Archive

Topic: connecting two openwrt routers

The content of this topic has been archived on 9 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello

I have two routers and I want to connect them in following way:
1. First router is set up in client mode and it's sharing the internet connection interfaces are separated and everything is working ok, there is dhcp enabled.
2. second one I want to connect to the first one by ethernet and use it as access point for my pocketpc.

Now my question: how to set up the second one to use dhcp from first router and not use it's own, I wan't it act for wired and wireless equipment just as simple switch which nvram variables I need to change from it's default and what else I need to do.

Sorry for my bad english and thanx in advance

Disable the DHCP server on the second one (I think the best way to do that is in /etc/dnsmasq.conf , maybe remove dhcp-authoritative or something).

Put the LAN interface itself on dhcp ( nvram set lan_proto=dhcp ) or on a static IP within the subnet of the first box.

Connect both boxes on their LAN connections.

If I'm not mistaken, that should do it.

Thank you for your answer Jannes, I don't need to make any changes to WAN interface and routing table?

nrg wrote:

I don't need to make any changes to WAN interface and routing table?

Unless you broke the bridge, routing shouldn't be required. Is it not working? AFA the wan interface, either don't use it or move the port to the lan vlanXports.

- DL

(Last edited by dl on 14 Dec 2005, 07:58)

dl I'll try to do it when I back home and let you know if it works smile Thank you.

Hello everything is workin as you said, thank you for your help smile unfortunatelly I need to make change in my config because I didn't thought that after doing switch from router I won't be able to connect to it :-D so now I have to brake the bridge, turn on dhcp again and lern a lot about routing and networks...

nrg wrote:

Hello everything is workin as you said, thank you for your help smile unfortunatelly I need to make change in my config because I didn't thought that after doing switch from router I won't be able to connect to it :-D so now I have to brake the bridge, turn on dhcp again and lern a lot about routing and networks...

If all you need is management access, just change the lan_proto from dhcp to static and assign an ip in the same subnet but out of the range of the dhcp pool being handed out by the other router.

- DL

Just a hint - due to the way linksys handles lna_proto, we've forced lan_proto to be static ... to set  lan_proto=dhcp you'll need to comment out the override in /etc/nvram.overrides

DL thank you once more, now I have everything as I wanted smile

MBM thanks for hint, now it's set up as static anyway so I don't need to add comment in nvram.overrides

If you are so good in resolving problems I have just one more... And it's connected with my first router working in client mode. I needed to write starting script to automaticly connect to access point because sometimes it wasn't connecting. Script is very simple and it gives command 'wl join ssid' when there is no ping from access point. I was serching for the problem for over a month trying many options but unfortunatelly I'm still with this problem. Could you guide me what can it be or where I have to check cause I'm allmost giving up. Could it be a B mode network problem? Access point which I'm connected to is using B mode.

nrg wrote:

If you are so good in resolving problems I have just one more...

... actually Jannes supplied everything you needed smile

And it's connected with my first router working in client mode. I needed to write starting script to automaticly connect to access point because sometimes it wasn't connecting. Script is very simple and it gives command 'wl join ssid'

B mode should not be an issue. My clients automatically associate without need of startup script. Check the following:
- AP must be open, broadcasting SSID
- wl0_ssid must be set on client

My clients didn't automatically associate at first either - I had to change some settings to get it to work. I don't remember exactly what I did or even whether it was on the AP or client, but it -may- have been when I set up wifi_ interface on the client.

- DL

dl wrote:

- AP must be open, broadcasting SSID
- wl0_ssid must be set on client

those conditions are fulfilled

dl wrote:

My clients didn't automatically associate at first either - I had to change some settings to get it to work. I don't remember exactly what I did or even whether it was on the AP or client, but it -may- have been when I set up wifi_ interface on the client.

- DL

I set everything as it's written in docs but there is solution with changing WAN interface to eth1 so probably it causing all problems according to mine impression and your assupmtion that it changed after setting up wifi_ interface. I'll try to do the same but here again my lack of knowlage in routing and linux generally is a little problem :)

nrg wrote:

I'll try to do the same but here again my lack of knowlage in routing and linux generally is a little problem smile

Setting up wifi_ via nvram vars shouldn't require any changes in routing assuming you set wifi_ifname to eth1. But setting this up seems to invoke some wl stuff that doesn't happen otherwise - or perhaps it's a timeing/sequence issue.

- DL

(Last edited by dl on 15 Dec 2005, 09:53)

The discussion might have continued from here.