OpenWrt Router Acting as Switch of Primary Router

Hello,
I have one Dlink DIR 825 and one GL-MT300Nv1. Here Dlink is my primary router with 192.168.2.0/24 LAN address. In GL-MT300Nv1 I set LAN address 192.168.4.0/24.

GL-MT300Nv1 is connected by wire as DHCP Client of DIR 825. Problem is when GL-MT300Nv1 start it treat as DIR 825 (192.168.2.109) network. That case, either I have to unplug WAN cable from GL-MT300Nv1 or Plug WAN cable after booting up entirely.

What should I do here?

What is your goal? How do you want things to work if you connect clients to:

  • The DIR 825's wired ports
  • The DIR 825's wireless
  • The MT300N's other wired port
  • The MT300N's wireless

?

I just like to make GL-MT300N as a normal router. Let just thought DIR 825 as a ISP Router.

In a "typical" home network with xDSL, you have ISP xDSL modem (or ISP modem-router set-up in bridge mode) connected to the router's WAN port as PPPoE (or whatever your connection is). Other scenarios include doing the "routing" and the NAT on the "ISP modem-router", and using the OpenWrt router as switch/AP. More about different cases can be found here https://openwrt.org/docs/guide-user/network/switch_router_gateway_and_nat

It appears that you are doing double NAT. This isn't necessarily wrong, but can be unnecessary overhead unless you have reason to do so (or if you are doing it to test something).

Now back to the original question, do you mean that the LAN interface of your GL-MT300Nv1 gets an IP from Dlink DIR 825 if WAN is connected during boot? There were some posts about that issue. Out of curiosity, does the problem also persist if you have the WAN set as static?

Topology is,
ISP <> PPPoE <> DIR 825 <> DHCP <> GL-MT300N <> DHCP <> Mobile Device

Yeah, When I plug WAN port of GL-MT300N with DIR 825 LAN it supposed to get IP address of 192.168.2.109 as Dynamic. But when WAN port plugged and I let GL-MT300N boot automatically it treat as DIR 825. That case I have to unplug WAN port and re-plug after couple of seconds. Only that option provide me 192.168.4.1 IP range. I haven't tried with static WAN.

Do you have a reason for that? Why two routers? And why double NAT?

What do you mean by "as Dynamic"?

First of all it's not about the reason. Lets asume that 1st Router provided by ISP. 2nd one is mine for testing.

ANd Dynamic means it is Dynamic DHCP IP.

Are you setting you LAN interface as DHCP client? That's not a good idea!! Set it to static.

Lan is static IP with DHCP server, and WAN is DHCP Client.

Then I really can't understand what you are saying here.

What interface of GL-MT300N you want to get that IP? and from which DHCP server?

I get what you are saying now (though I have no ideas other than trying to set WAN as static and see if it helps. I'm not familiar with this device and the diagram of its switch, and I don't know if what you are experiencing is related to the VLANs settings being unavailable at boot time.

By the way, it's good practice to mask your MAC addresses.

Yeah that might work, But this is my travel router so I like to plug in to multiple router. This is the reason I like to make it as a DHCP Client.

It is a known issue, you need to let the GL boot and then plug in the cables.

So no work around for this issue yet?

The problem is that the bootloader brings up the switch in a mode where all the ports are connected together. This creates a "leakage" situation until OpenWrt has a chance to start up and reconfigure the switch as separate LAN and WAN.

The cure would involve a bootloader modification, which is outside the scope of OpenWrt.

3 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.