How to connect/bridge two subnets within the same router

Hi, all,

I followed this instruction to connect my desktop computer to wifi.

Now, my desktop has the IP address "192.168.2.14" while my laptop which connects to the same wifi has an IP address "192.168.1.16".

I have some files shared in my desktop running windows 11. But my laptop cannot find those files by visiting "192.168.2.14". How do I connect/bridge two subnets within the same router? Any solutions? Thanks

That would be (inter-zone) routing, not bridging - set your firewall settings accordingly.

Thanks. Do you mean the firewall setting in openwrt? Sorry that I am new to Openwrt. Could you tell me a little more about how to set it up?

Should I follow this instruction?

Can you explain this a bit more? The same wifi?? If they are connecting to the same SSID, they should both have addresses in the same subnet.

What is your topology? Do you have multiple routers in use here? A diagram would be helpful (a simple photo of a sketch on paper is good). What is your desired situation -- do you want to have one contiguous network, or are you looking to have different subnets for different systems?

Sorry for the confusion. I mean my landlord provided a wifi named "hjx8". My laptop connect directly to the wifi "hjx8" while my desktop connects to TP-link AC1750 via a ethernet cable. Then, TP-Link AC 1750 runs openwrt and I used the instruction I mentioned. That is why my desktop computer has an IP address "192.168.2.14" and my laptop has an IP address "192.168.1.16". The desktop runs windows 11 and shares a folder, but my laptop cannot access the folder. This is the issue. I hope this clarifies everything. Thanks

So these are not the same wifi networks at all.

You probably should simply reset your router and use it in the standard router mode. This nearly a default configuration, except that you will use a wireless WAN that connects to the hjx8 upstream network. Then you will have a LAN that can be used for both your wired and wireless devices (use a different SSID for your own LAN). With all of your devices on the same network, sharing will be easy. But you'll also have the benefit of preventing your landlord or others from connecting to your machines.

The Travelmate package makes this pretty easy to accomplish.

2 Likes

Great. This sounds a very good idea. I will try it and let you know. Thanks

@psherman Hi, your solution works somehow. Right now, I use the 2Ghz channel to connect to hjx8 upstream network. Then, my desktop connects to the router using an ethernet cable. My laptop connects to the 5Ghz channel. Now, my laptop has an IP address "192.168.2.5" while my desktop has an IP address "192.168.2.14". So, both my laptop and desktop can access internet and windows file sharing is also not an issue. But internet is slow because only the 2Ghz channel is used for upstream network.
However, could I use the 5Ghz channel to connect to hjx8 upstream network? However, right now, the 5Ghz is used to connect my laptop via a local "openwrt" wifi. When I try to enable the 5Ghz channel for upstream, my router disconnects/restarts. I don't know why. Is there any solution? Thanks

Make sure your country code is set correctly and that you have the channel set for auto on the ap mode for the radio you are using for the uplink.

You could make your uplink use the 5G radio (in sta mode) and the downlink would be wired and 2.4G radio (in ap mode), as an option. You can, of course, use the same radio for up and down, but this will reduce performance.

Try it both ways and see what works best for you.

@psherman Thanks a lot!

I just read this link

My router, tp-link archer a7 ac1750, should support this, right?

I tried several times. Sometimes, the 5G radio can see the upstream "hjx8" wifi. But just when I try to connect to it, my router disconnects/restarts.
So, I feel editing the Openwrt network configure file directly to add the 5G radio may solve my problem.

Also, are you sure that use the same radio for up and down will reduce performance?
Could you explain this?

Are you sure that the upstream wifi is 1) available on 5G, and 2) of sufficient signal strength to be useful?

Yes. Simple analogy;

  • You speak two languages.
  • You work as an interpreter, facilitating a discussion in two languages.
  • You must listen to the words from person A and then repeat them in the other language to person B.
  • Then, you must listen to person B and repeat the words in the language of person A.

The conversation will take place at half the speed that it would if it was just two people communicating directly in a single language.

If the same radio is used for both AP and STA modes, it must constantly switch between the two modes, just like the interpreter does with languages.

@psherman Yes. I am pretty sure. I used my M1 Macbook to connect to the upstream "hjx8" wifi and the speed is about 230Mbits/s. My TP-Link router can only reaches about 50Mbits/s because it uses the 2.4Ghz signal.

It is worth explicitly verifying that this is connecting via 5G.

@psherman Got it. How much performance degradation, you think, will get in this situation?

You should expect a 50% performance drop when using the same radio in STA + AP modes. The actual data rate will depend on many other factors (including the quality of the upstream signal)

Yes. My macbook shows "PHY mode: 802.11ax ". Sorry that I forgot to mention this.

Ok, so that will be 5G. Let's look at your config files:

Please copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

cat /etc/config/network
cat /etc/config/wireless

@psherman Sorry for the delay. Here are the two files:

wireless file:

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'pci0000:00/0000:00:00.0'
        option band '5g'
        option htmode 'VHT80'
        option cell_density '0'
        option channel 'auto'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'psk2'
        option key 'xxxxxx'

config wifi-device 'radio1'
        option type 'mac80211'
        option path 'platform/ahb/18100000.wmac'
        option channel '1'
        option band '2g'
        option htmode 'HT20'
        option cell_density '0'
        option disabled '1'

config wifi-iface 'default_radio1'
        option device 'radio1'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'none'
        option disabled '1'

config wifi-iface 'wifinet2'
        option device 'radio1'
        option mode 'sta'
        option network 'wwan'
        option ssid 'hjx8'
        option encryption 'psk2'
        option key 'xxxxyyyy'
        option disabled '1'

config wifi-iface 'wifinet1'
        option device 'radio0'
        option mode 'sta'
        option network 'wwan'
        option ssid 'hjx8'
        option encryption 'psk2'
        option key 'xxxyyyy'

Network file:

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd4b:5961:39c1::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0.1'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.2.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config device
        option name 'eth0.2'
        option macaddr '50:d4:f7:c2:6a:0e'

config interface 'wan'
        option device 'eth0.2'
        option proto 'dhcp'

config interface 'wan6'
        option device 'eth0.2'
        option proto 'dhcpv6'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '2 3 4 5 0t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '1 0t'

config interface 'wwan'
        option proto 'dhcp'

Right now, my desktop computer uses 5Ghz to connect to upstream wifi "hjx8". So, it has fast internet access. However, the "openwrt" AP 5Ghz wifi does not show up even when it is set up.
So, my laptop and phone cannot find a wifi called "openwrt". I also attached a screenshot here:

Do you have any solution to my problem? Also, are you sure my router can really use the 5Ghz channel for the AP mode and client mode at the same time?

Thanks,