Help me to configure different subnet for different lan ports

hello guys,

im trying to configure different subnet for lan port but aren't successful yet.

already discussed in the below topic

someone please guide me how to set up subnet for a specific port.

i have belkin RT3200 router.

thanks,

What's in /etc/config/network?

bro if i connect my laptop to lan2 which i already configured with different subnet it is working fine.

but the problem occurs when i connect my 2nd openwrt router to lan2.


  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 24.10.0, r28427-6df0e3d02a
 -----------------------------------------------------
root@Androidtv:~# cat /etc/config/network

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 'fd5a:df57:27ba::/48'
        option packet_steering '1'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'lan1'
        list ports 'lan3'
        list ports 'lan4'

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

config interface 'wan'
        option device 'wan'
        option proto 'dhcp'

config device
        option type 'bridge'
        option name 'gaming'

config interface 'guest'
        option proto 'static'
        option device 'gaming'
        option ipaddr '192.168.82.1'
        option netmask '255.255.255.0'

config device
        option type 'bridge'
        option name 'br-lan2'
        list ports 'lan2'

config interface 'lan2'
        option proto 'static'
        option device 'br-lan2'
        option ipaddr '192.168.5.1'
        option netmask '255.255.255.0'

root@Androidtv:~#

Can you provide more information regarding this important point?

actually im configuring lan2 port on my router will work under wg interface so to achieve this i must have a different subnet for lan2 port which i already configured by the help of below guide

i skipped the wireless part in below guide because i don't need guest ap.

https://openwrt.org/docs/guide-user/network/wifi/guestwifi/configuration_webinterface

now the 2nd router connected to lan2 doesnt have internet but if i connect my laptop to the lan2 port internet is working fine and if i connect my 2nd router to other ports it works fine.

the 2nd router is not dump AP it is connected to my router through WAN port and also do have different subnet for br-lan than my main router lan2 which i assign 192.168.5.1.

You've already managed to answer your initial question about how to configure a different subnet on a specific interface:

You have a bridge (br-lan) joining lan1, lan3, and lan4, and a logical interface assigned to that bridge with an address in one subnet.

You've got a bridge (br-lan2) joining lan2 to nothing else, and a logical interface assigned to that bridge with an address in another subnet.

You have achieved what you set out to achieve.

you mean to say then 2nd router br-lan address should be in the subnet of br-lan2?

No, I'm saying you got your desired result: two separate interfaces in two separate subnets.

1 Like

but the problem is still there i dont have internet on other router in lan2 subnet.