Simple way using LuCI to convert WAN port to LAN?

I could use some help for properly configuring my MT300a.

I’ve got it configured as a WISP repeater connected via WiFi to my main router for internet access. I have my Synology NAS hardwired via ethernet into the LAN port on the MT300a. I frequently do file transfers from my laptop to the NAS for backup, and right now I have to do it using WiFi. I’d like to be able to use an ethernet cable from my laptop into the WAN port on the MT300a to make the transfers faster and more reliable.

I know this is possible from my research, but I’m too much of a novice to make it happen. I believe I can create a VLAN, but I haven’t been able to make it work yet. Is it doable from LuCI, or do I need to use the command line?

I know I can just use an ethernet switch, but I’d like to learn how to use the tool I have better!

Also, can this easily be undone for when I take the unit on my travels and need the WAN port to function normally.

Thank you

1 Like

In Luci, under interfaces edit the LAN interface. There you will find a set of tabs. On the Physical tab you will see that on the LAN side that there are check box’s and the first one is for bridging. Below you will probably see that the LAN (eth1?) and the Wireless Master are both checked. For the other interfaces you will only see a radio button. They are not by default bridged.

Your goal, I think, is to add the other eth0(?) to the bridge so that both that both Ethernet ports and the wireless are all on the LAN side. This means that you can only connect to the outside world via wireless, but it sounds like you understand that. I have not tried this, but think that I have seen posts elsewhere on this “recipe”. I do not think it’s just as easy as checking the box. I expect you need to remove the WAN6 interface, but not sure.

You can use the backup and restore to manage your different configs. If you are “script savvy” you can probably write something to replace the config files via a button or switch action.

I’m not clear how the GLi GUI will work if you make these changes.

Learning is one thing, but from a practical perspective and for reliability, get a switch and then just connect it to the LAN port. Managing config sets is a pain. Been there, done that. If you make a change to the config, you need to also update the gold copy. Just hard to manage.

1 Like

Thanks for the quick response. I’ll give it a try mainly to prove to myself that it can be done. It does seem, however, that management of the different configurations is troublesome and perhaps not worth the pain (as you indicate). I’ve got an old switch that I’ll use for now.

“Your goal, I think, is to add the other eth0(?) to the bridge so that both that both Ethernet ports and the wireless are all on the LAN side. This means that you can only connect to the outside world via wireless, but it sounds like you understand that.”

Yes, that is correct.

I’ve had limited success with button based script actions using this router, but that would be an idea solution. Perhaps it could be added in a future firmware update.

 

@PhilS and @RangerZ, I suppose that you want to change the “WAN port” to “wan” or “lan” easily as needed.

This is not difficult and you can use the hardware switch to do this.

I have the script http://www.gl-inet.com/download/script/

“swith_mode” is the script to bridge the two port, which does exactly what you want.

“BTN_1” is the script to bind the function to the switch.

The problems is that it is hard to make a good UI so that users configure this easily, so this never appear in the UI. But I think this should be implemented asap.

@alzhao, Thank you for the suggestion. I tried your scripts, but for some reason it did not work.

 

The existing “switch_mode” script in my router was identical to the one you linked. I modified the “BTN_1” script to match the one you linked, but it did not seem to do anything other than reboot the system, or at least toggle the power of the WiFi. In either position of the switch, I was unable to get an IP address assigned on the WAN port. Am I wrong to think that the DHCP would also assign an IP there when in the AP configuration?

 

@PhilS, maybe you made some mistake when you modify BTN_1

In BTN_1 there is no command to reboot the system or toggle the wifi.

Can you please check again?

I checked the script again and it was fine. I tested some more and I was able to get the expected results when the switch was moved to the right (away from the USB port). There was still no DHCP assignment done (this would be nice!), but when I manually configured the IP address of the PC connected to the “WAN” port, I was able to bridge the connection.

I did observe the WiFi radio turning off, but I think that was associated with it dropping the wisp connection (where it’s locked to my main router’s channel) and rebroadcasting on my GLi router’s selected channel.

Either way, it seems to work and do what I need with some additional configuration. Thank you!

For DHCP you can unplug the Ethernet cable and plug it again and it will get DHCP address. The reason is that your PC didn’t get noticed that the network has been changed and it needs a new IP address.

Another thing, this works after the router boot up and when you move the switch. When the router is powered off and you move the switch and power on the router after that, it doesn’t take effect. What you can do is the modify the script /etc/init.d/init_switch. Now the script does nothing but just a framwork. You can fill the script according to BTN_1 and this will work as well.

Excellent, thank you!

For those coming from Google who just want to remap the WAN port to act as a LAN port, the link you want is 404 Page not found - GL.iNet

(there’s a switch on your router (next to the Reset button), alzhao’s instructions in this thread describe how to set the button to toggle whether the ethernet port labeled WAN acts as WAN or as LAN. You probably don’t need that)

 

Hi there,

This is exactly what I’d like to do. I want to set my GL-MT300Nv2 up to be a wired access point and also a print server all on my main LAN. So, I’d like to plug my ethernet wire into one of the ethernet ports, printer into the USB port and then have the second ethernet port (currently the WAN) as a spare to be able to plug a NAS into.

I copied alzhao’s switch_mode script into the /bin directory and ran it but it didn’t seem to work for me:

root@GL-MT300N-V2:/bin# switch_mode

Please specify mode: router or bridge

udhcpc: started, v1.25.1

udhcpc: sending discover

udhcpc: no lease, failing

Note that it ran without any input from me.

Any pointers please (also I followed the guide in the link provided by 800718 but no luck there also).

So, basically, just a simple way to turn the WAN port into a LAN port identical to the other LAN port…

Hi the link is broken

Hi @MozOz, I found the scripts at that broken link using the wayback web archive.

The reset script script is at http://web.archive.org/web/20180403054120/http://www.gl-inet.com:80/download/script/reset and the BTN_1 script is there too. The switch mode scripts were not on the archive, but if you look inside your router’s /usr/bin folder you will see the switch_mode script is actually installed (at least on recent firmware versions it is).

Hope this helps

Please try the latest testing firmware. http://download.gl-inet.com/firmware/mt300n-v2/testing/

Don’t ticked “keep settings” when upgrading. The new firmware support convert WAN to LAN, it is very easy to set up.