Newbie here setting LEDE up as a wireless router. I installed LEDE on Raspberry Pi 3 B and the config below is what I currently have. I am connecting RPi with campus Ethernet via cable.
When I tried to connect my phone to it, IP address couldn't be obtained. Anybody help me have a look what I cam doing wrong / not doing?
Thanks for your help. Doing so allows me connecting to the network and this was actually what I did at the beginning. My confusion is that with this setting the AP acts like a bridge as if I am connecting my phone to the wall's outlet but without a wire. What I want is make the RPi a router that assigns IP addresses to mobile devices.
To explain this clearer, the campus Ethernet requires a registration before establishing connection. My RPi's MAC address should have been registered, yet when I connect my phone through it (after adding option network 'lan') it asks me to register my phone again. I am not expecting this step because the WLAN should be created by the router. I have successfully made what I want to achieve before with the help of some tuto online but couldn't remember how to repeat.
You want a setup that is like a conventional router then. There are two networks, lan and wan in that.
The default configuration should be close to what you need. So I would suggest you re-flash your SD card back to the distributed image and start over.
The lan will be a static private IP range with a DHCP server. Create a wifi AP and attach it to the lan network as you did before.
Log into the router via wifi, since you will need to remove the ethernet port from lan and make a wan network to connect it to the ISP.
Create a wan network with proto dhcp (a dhcp client) and attach the ethernet port to it.
Firewall rules should already be in place to route from lan to wan. Be sure to use lowercase for all your network names.
The first time you connect a device it will have to log in. But now the college only sees one MAC address (the router's wan interface), and has issued only one IP, so once it has been authorized you can connect additional devices to your lan network and the college will treat them all as one user that is already authorized.
Thanks. Your answer sounds what i want. Unfortunately these are what I tried myself before making this post here and ended up with the two config files at the top XD.
Can you explain with a bit more details? e.g. how to do this:
You don't want the lan interface associated with eth0. The lan will essentially not have any interfaces associated with it since your device only has 1 ethernet port (eth0), which will be associated with your wan interface. Only your wireless interface will be accessing lan, so it is not required to have 'option ifname' in this case for the lan interface. The wireless is associated with the lan interface in your /etc/config/wireless.
Essentialy, you want br-lan when your run an 'ifconfig' to have a static IP of 192.168.1.1. The lan interface will act as a DHCP server to your wireless since it is associated with the wlan0 in your '/etc/config/wireless'. It will assign your devices that connect to it over WIFI an internal IP address of 192.168.1.x. The only MAC address your campus ethernet should see is that of eth0 at that point. From there you should only have to just log in one time, initially, from a connected device to associate the wan MAC address with the campus network.
I am trying to do as you have instructed, but without success. ifconfig now has output address 192.168.1.1 for br-lan, but my phone still cannot connect because cannot obtain IP. Is the LAN supposed to act as a DHCP server once the wlan interface is associated with it? Anything wrong with the following configs? These two files are the only ones I have been changing but please tell me if there is any other file that matters.
Check to see that under the interface for 'br-lan' that 'wlan0' is there. If it is then it is a DHCP configuration problem on the LAN interface most likely. Post the contents of '/etc/config/dhcp' if it is there. If it is not there then run the command:
brctl addif br-lan wlan0
You may have to add that command in /etc/rc.local so that it is executed each time after a reboot if it that solves the issue.
Hi @mj5030. First of all I cannot SSH to it with this configuration (am I supposed to be able to? I tried many times and could only SSH to it when I set lan's protocol dhcp).
I ran brctl directly inside RPi's through keyboard, and found no wlan0 under interface br-lan from the output of ifconfig (if this is what you mean). Then I ran brctl addif br-lan wlan0 and see the following:
Oh you remind me of that: I was trying to SSH to the router from my laptop that wasn't connected to the AP --- it was still connected to campus WiFi. Now that I joined the router's network I can ssh to 192.168.1.1.
You really gave me great help here. Thank you very much!
At the beginning when the interface lan has
option ifname 'eth0'
option proto 'dhcp'
I was able to SSH to the RPi via the inet address on eth0 interface. Why can't I do the same now?
You really don't want SSH access enabled for the address on eth0. It's more secure to have it behind the lan. You can put it on the wan interface vs. the lan, or unspecified, and be able to access it through that address. But it exposes the SSH service to EVERYONE at that point. The reason you were able to access it before is because you had eth0 assigned to lan via DHCP. At that point, the lan got a Class A network address assigned to it. Your lan now has a Class C (internal) network address assigned to it and the wan a Class A (external), and now uses Network Address Translation (NAT) between the WAN and LAN. Only devices on your lan can connect to it now.