How to configure cross-segment routing?

My home’s intranet segment is 192.168.0.0/16, I divided into five segments, respectively:

  1. 192.168.0.0/24

  2. 192.168.101.0/24

  3. 192.168.2.0/24

  4. 192.168.3.0/24

  5. 192.168.4.0/24

I started the OSPF routing protocol, but I can’t get them to route and communicate with each other. Please tell me how to operate. Thank you.

To diagnose your problem we need some more information about your configuration. but, if this is a one-device solution you do not need, and should not use dynamic routing protocols as OSPF, RIP or BGP. these are only for use when using multiple routers.

could you please provide you configuration? you could fetch using this command show configuration | strip-private and upload via eg. pastebin.com or any other text upload service. before uploading also please look trough the configuration to identify any leftover sensitive information.

Specific configurations of vyos such as links:
https://pastebin.com/RtWS4BsS

Hello, @jack9603301!
You don’t need OSPF or any other dynamic routing protocols for this task. Instead, you need to configure or disable the zone-based firewall. By default, all traffic between zoned is denied, so you must define rules for all directions on all interfaces.
I would recommend you to delete OSPF, zone-policy, then check if everything will work. And only then, if this is necessary, prepare firewall rules and carefully add interfaces to zones.

The latest configuration is as follows. It seems that it can’t Ping 192.168.101.0/24 network segment from 192.168.0.3.

https://pastebin.com/6Us8Nwq1

From what i can se your configuration seems to be correct. have you checked that the gateway is correct on all you clients? also. from the client in 192.168.0, can you ping the gateway address in .101.?

Also, to make you configuration a bit more readable it is wise to name your bride interfaces the sane as your vlan identifier. eg. br3 is vlan 1002, so then call the bridge interface br1002 . that will make the configuration a lot more readable in the future :slight_smile:

I just tested that ping’s own gateway is normal, but I found a magic problem. I can initiate an ICMP Echo request from a computer with IP 192.168.101.3 to a gateway with 192.168.0.1, but it can’t reach 192.168.0.3.

I suspect that it may be the setup of VLAN and OVS switches? When I close the BR1 bridge on the server running the OVS switch by ifconfig BR1 down, communication is normal. The management address of the BR1 switch is tag2, which matches the vyos setting. Is it possible to cause problems? Such as VLAN setting error?

Fixed, BR1 bridge tag equals 1