Can I separate ethernet 1 and ethernet 2 of Xiaomi Router 3G?

Hi everyone, I want to use lan port 1 to access internet from PPPoE. And lan 2 to access internet from 4G usb modem. Can I set up like that with Xiaomi Router R3g running OpenWRT?

https://openwrt.org/docs/guide-user/network/routing/pbr

2 Likes

Thank you. I trying mwan3, but don't know. How can i add lan 1, lan 2 port of router to member tab of mwan3 ? Can you guide me this step ?

First you will need to remove the physical ports lan1 and lan2 from br-lan so they can be used for other purposes. This only leaves wifi for the lan network.

Create additional wan interfaces (name them for example wan2 and wanlte) and set an Ethernet port (lan1 or lan2) as their device. One will be protocol pppoe and one protocol dhcp. Add these interfaces to the wan firewall zone.

Finally install and set up mwan3 to control how the different wans will be used. PBR may also be of interest if you want to have additional wifi networks that each default to a different wan. Note that routing packages use the interface (network) name that you built in step 2 not the port name.

1 Like


My router have 1 wan + 2 lan port. But i see in device list only show eth0 and eth1. So it is define eth0 for lan 1 and eth1 for lan 2, or eth0 for wan, and eth1 for both lan 1 + lan 2 port.

I see in Switch menu show full wan, lan1, lan2.

It appears you are running an old version of OpenWrt which is still swconfig. You should upgrade to the new version which uses DSA. In DSA there is no more Switch page and the ports wan, lan1 and lan2 can be chosen directly from a list.

1 Like

Maybe, i description not right my goal. I wan use lan 1 port for access internet from PPPoE dial connect from Wan port of router and lan 2 port for access internet from usb modem 4G. I don't understand step create more a wan protoco PPPoE. Is with my goal, i must create 2 protocol dhcp on lan 1 and lan 2 ?

X-WRT is not the same as OpenWrt. You need to ask on their support channels.

It appears you are using firmware that is not from the official OpenWrt project.

When using forks/offshoots/vendor-specific builds that are "based on OpenWrt", there may be many differences compared to the official versions (hosted by OpenWrt.org). Some of these customizations may fundamentally change the way that OpenWrt works. You might need help from people with specific/specialized knowledge about the firmware you are using, so it is possible that advice you get here may not be useful.

You may find that the best options are:

  1. Install an official version of OpenWrt, if your device is supported (see https://firmware-selector.openwrt.org).
  2. Ask for help from the maintainer(s) or user community of the specific firmware that you are using.
  3. Provide the source code for the firmware so that users on this forum can understand how your firmware works (OpenWrt forum users are volunteers, so somebody might look at the code if they have time and are interested in your issue).

If you believe that this specific issue is common to generic/official OpenWrt and/or the maintainers of your build have indicated as such, please feel free to clarify.

1 Like

I just up rom penwrt-23.05.5 for my router. And seen device list separate lan 1, lan 2, wan.

Great. At this point, you should be able to do what you want, right?

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.
Thanks! :slight_smile:

If i use wan for dial connect PPPoE and lan2 run dhcp protoco. What i need setup more, for get internet from Wan to lan2 ?

  1. Remove lan2 from br-lan (interfaces > devices)
  2. create a new interface for your new wan (maybe wan2)
  3. use device lan2
  4. set protocol dhcp
  5. assign the interface to the wan firewall zone.
  6. you'll also need to install and configure mwan3 if you've got two wan interfaces.

I removed lan2 from br-lan. And config as image bellow.

And config mwan3 as image bellow:

Now, when i plug in ethernet cable from my computer to lan2 port of router. I can't access internet. Is my config wrong?

Hmmm... seems like there has been a misunderstanding here...

The above statement suggested that you were trying to setup a second wan. "DHCP protocol" is what you use for an interface when there is an upstream connection.

However, your latest comment about connecting an Ethernet cable between your computer and lan2 suggests that you actually wanted to use the second port as a lan.

In fact, lan1 and lan2 would both have been operating as lan ports -- in this case both on the same network. Were looking to make the two ports have different networks

Please confirm and describe your specific goals.

Example: My xiaomi router 3G have 1 public IP from dial connect PPPoE on Wan port. Second public ip from usb modem 4g. Normal when i stop PPPoe protoco from Wan port, my router will switch to usb modem 4g for access internet. Now, i want access internet of lan1 port from Wan port source. And access internet of lan 2 port from usb modem 4g. Both same time, but separate on 2 another lan port. Mean is lan 1 port have public ip from PPPoe, and lan 2 port have public ip from usb modem 4g.

Ok... so you need to change the protocol of your lan2 network to static. Then set a static IP. It must be a unique subnet, so it could be 192.168.2.1 (with subnet mask 255.255.255.0), as an example.

Enable a DHCP server for that network, and then change it to use the lan firewall zone.

Finally, configure mwan3 to use each wan respectively.

That said, I do not see your USB 4g modem in your interfaces. You'll obviously need to set that up if you haven't done so already.

I want tried wan to lan2 first. If success i will continue setup for usb modem 4g. 4G to lan1. Thank you so much.

Is it possible for setup wifi 2.4 ghz use ip of PPPoe and wifi 5 Ghz use ip of 4G modem too ?

Yes and no.

It will not work as is now, but you can reconfigure the networks and bridge so that you have bridge-vlans. Had you mentioned this earlier, I would have suggested the bridge-vlan method... now you'll need to go back and reconfigure a bit.

Can you help me config mwan3 ? I tried switch lan2 to static protoco and can access gateway 192.168.1.1 on lan2 port. But it still don't have internet on lan 2 port.

I think it have issue in mwan3 config. I check status mwan3 it show: "interface Lan2 is error (16) and tracking is active". My setup for mwan3 is same as post above.

Remove the gateway -- leave it blank.

Reboot and try again.