Again problems configuring a switch

Hello, it's me again from Same problem. After I done it to a device it works all fine. Now I need a second device with this settings. After applying them to the device it works but only when the ipv4 address 10.10.., 10.11..., when I try like 10.2.1... that doesn't work.


(I took this screenshot before I applied the settings, so done wonder about the ipv4 address in status)

I set the ip address of the device to 10.2.1.200
the subnetmask to 255.255.255.0
my laptop got the ip address 10.2.1.201
-> that doesn't work

I set the ip address of the device to 10.13.1.200
the subnetmask to 255.255.255.0
my laptop got the ip address 10.13.1.201
->that worked

why can't I use 10.2.1.200?

Because that designates the subnet itself.
in a /24 subnet your usable ip address are 1 - 254

sry, but I didn't understand completely. When I assign a subnet like 10.2.0.0/24 then I can use 10.2.1.200. What's the different between the subnet 10.2.0.0 and 10.10.0.0?

Sorry my bad, did not read properly.

In your screenshot the IPv4 gateway shows as 10.13.1.201 are you sure that is correct?

when in doubt leave it empty

You might get an overlap with the DHCP range, that is something to take into consideration, although DNSMasq should take care of that

You are using a /24 network which only covers 10.13.1.1-10.13.1.254. Anything outside that range will be unreachable unless routed accordingly.

Maybe you could describe what exactly you did and what did not work as a result.

Please connect to your OpenWrt device using ssh and 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:

ubus call system board
cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall

Hey, yeah that's not possible because I can't connect to my device, when I use the ip- address 10.2.1.200 as the ipv4 address. When I use 10.10.1.200 or 10.13.1.200 or anything above 10.10 then all works fine and the way I want.

I used my old topic because its all the same I did : How to configure a switch
So the only thing I changed here is, that I am using as the ipv4 Adresse 10.2.1.200 instead of 10.10.1.200 as the ipv4 address of the "lan" interface

it should be, it works with all other ip addresses

I can post it after connecting using 10.10.1.200, do you need that or is this not useful ?

The vlan assignment still doesn’t achieve anything useful.

But the fundamental problem is that you are connecting to an upstream network that has a certain range. When you go outside to that range, is becomes unreachable as expected because there is no path to the new range.

But then I didn't understand why the only ipv4 address that I can't use is 10.2.1.200. I can use like 10.5.1.200, 10.5.6.1.200, and so on

Because each of those is on a different /24 network subnet. The router has set up a /24 which means that the first three octets always remain the same and the last octet is the host address.

Think of it like this: you setup a scavenger hunt on a college campus. There is an expectation that the scope of where they should be looking is the campus itself. If you want to expand the search range to a full city around the school, the entire state, maybe the whole country, you need to specify that at the outset by your subnet size.

that's clear for me, but when I define a subnet 10.2.1.0/24 then all usable ip addresses in this subnets are 10.2.1.1 - 10.2.1.253. So 10.2.1.200 and 10.2.1.201 should work

It is hard to understand the full context of your network - are you changing the subnet of a specific device, or of your entire network?

It's the entire network. I am building a new tiny network with the subnet 10.2.1.0/24 so I done this with 10.5.1.0/24 and all worked fine my Openwrt router get the ip address 10.5.1.200 and worked fine. When I try this with the subnet 10.2.1.0/24 I assigned my router the address 10.2.1.200 and my laptop the address 10.2.1.201. That doesn't work, I can't connect to the router .

Can you show us a topology diagram?


Thats the setup which doesnt work.

It should work.

Is the laptop directly connects? What port is being used?

Show your configs while it is still working.

Yes, it's weird. Because all other ip addresses working. Only when I try it with 10.2.1.200

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

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'lan2'
        list ports 'lan3'
        list ports 'lan4'
        list ports 'lan5'
        list ports 'wan'

config device
        option name 'lan2'
        option macaddr '48:a9:8a:ec:b1:72'

config device
        option name 'lan3'
        option macaddr '48:a9:8a:ec:b1:72'

config device
        option name 'lan4'
        option macaddr '48:a9:8a:ec:b1:72'

config device
        option name 'lan5'
        option macaddr '48:a9:8a:ec:b1:72'

config interface 'lan'
        option device 'br-lan.1'
        option proto 'static'
        option ipaddr '10.10.1.200'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option gateway '10.10.1.201'
        list dns '8.8.8.8'

config device
        option name 'wan'
        option macaddr '48:a9:8a:ec:b1:71'

config bridge-vlan
        option device 'br-lan'
        option vlan '1'
        list ports 'wan'

config bridge-vlan
        option device 'br-lan'
        option vlan '2'
        list ports 'lan2'

config bridge-vlan
        option device 'br-lan'
        option vlan '3'
        list ports 'lan3'

config bridge-vlan
        option device 'br-lan'
        option vlan '4'
        list ports 'lan4'

config bridge-vlan
        option device 'br-lan'
        option vlan '5'
        list ports 'lan5'

config interface 'ovs2'
        option proto 'none'
        option device 'br-lan.2'
        option force_link '1'

config interface 'ovs3'
        option proto 'none'
        option device 'br-lan.3'
        option force_link '1'

config interface 'ovs4'
        option proto 'none'
        option device 'br-lan.4'
        option force_link '1'

config interface 'ovs5'
        option proto 'none'
        option device 'br-lan.5'
        option force_link '1'



Why is the gateway set to the same address as your pc?

1 Like