Hello,
======
Edit:
No I've actually found a simpler solution to my problem : route the trafic back from the interface it came from, I do this as follows :
Now I just need help to make this persistent across reboots...
I guess some if-up command in my /etc/network/interface would do the trick but I'm not good with the syntax, and not sure if I can put several lines in there and if the order of the lines will be respected.
Here is what I have in there for the moment :
Thanks in advance for any help !
======
I'm realy new to networking it seems since it took me a while to understand why my ssh connection is dropping off, in fact, my client is going through the gateway but the return packets are coming directly since the server knows of a more direct route.
Now I could cut off the direct route alltogether but in fact I'd like to keep this route in case my gateway goes down (or I shutdown the gateway VM...).
So the server has these routes for now :
and that's true for all 3 last routes : I would like for the default route to be preffered to the last 3 "direct" routes since in fact when the 10.0.10.1 gateway is up it will work just fine (and as you see it breaks some things to keep the other routes when gateway is up... that's because my client has a 10.0.30.0/24 IP and is contacting the server on his 10.0.10.0/24 IP, so client to server goes through the gateway and return trip is direct since servers already lives on 10.0.30.0/24, but that bypasses the gateway and the next packets are then dropped since the TCP state has been killed seeing no traffic...)
I think there is a "weight" mechanism, but not sure how it would indeed detect that the 10.0.10.1 gateway is down...
Any hep in setting up this debian(proxmox) server to always prefer the gateway over the other known routes would be greatly appreciated, info on how gateway status is evaluated is also welcome !
I think I need to add a route "10.0.30.0/24 via 10.0.10.1 dev vmbr10" that would have a higher weight than the existing route to 10.0.30.0/24.
But I'm realy looking for info on how proxmox would detect that the first route does not have a chance of working..
Thanks in advance,
Regards
Edit: looking up route weight, it seems it's not what I need... In fact, I want some failover of routes... can we change the routing table if a CARP VIP is free for example ? In fact, vmbr10 will never be down since it's a bridge with a virtual link to the gateway, and physical to the failover gateway... but both gateways that are fighting for the CARP VIP might be down (with my skill in opnSense that happens more often than I wish, and then this direct route is my last resort to access proxmox and rescue the situation...)
======
Edit:
No I've actually found a simpler solution to my problem : route the trafic back from the interface it came from, I do this as follows :
Code:
echo 200 myname >> /etc/iproute2/rt_tables.d/myname.conf
ip rule add from 10.0.10.0/24 table myname prio 1
ip route add default via 10.0.10.1 dev vmbr10 table myname
Now I just need help to make this persistent across reboots...
I guess some if-up command in my /etc/network/interface would do the trick but I'm not good with the syntax, and not sure if I can put several lines in there and if the order of the lines will be respected.
Here is what I have in there for the moment :
Code:
auto vmbr10
iface vmbr10 inet static
address 10.0.10.9/24
gateway 10.0.10.1
bridge-ports vmbr0.10
bridge-stp off
bridge-fd 0
======
I'm realy new to networking it seems since it took me a while to understand why my ssh connection is dropping off, in fact, my client is going through the gateway but the return packets are coming directly since the server knows of a more direct route.
Now I could cut off the direct route alltogether but in fact I'd like to keep this route in case my gateway goes down (or I shutdown the gateway VM...).
So the server has these routes for now :
Code:
# ip route show
default via 10.0.10.1 dev vmbr10 proto kernel onlink
10.0.10.0/24 dev vmbr10 proto kernel scope link src 10.0.10.9
10.0.11.0/24 dev vmbr0.11 proto kernel scope link src 10.0.11.9
10.0.30.0/24 dev vmbr0.30 proto kernel scope link src 10.0.30.9
and that's true for all 3 last routes : I would like for the default route to be preffered to the last 3 "direct" routes since in fact when the 10.0.10.1 gateway is up it will work just fine (and as you see it breaks some things to keep the other routes when gateway is up... that's because my client has a 10.0.30.0/24 IP and is contacting the server on his 10.0.10.0/24 IP, so client to server goes through the gateway and return trip is direct since servers already lives on 10.0.30.0/24, but that bypasses the gateway and the next packets are then dropped since the TCP state has been killed seeing no traffic...)
I think there is a "weight" mechanism, but not sure how it would indeed detect that the 10.0.10.1 gateway is down...
Any hep in setting up this debian(proxmox) server to always prefer the gateway over the other known routes would be greatly appreciated, info on how gateway status is evaluated is also welcome !
I think I need to add a route "10.0.30.0/24 via 10.0.10.1 dev vmbr10" that would have a higher weight than the existing route to 10.0.30.0/24.
But I'm realy looking for info on how proxmox would detect that the first route does not have a chance of working..
Thanks in advance,
Regards
Edit: looking up route weight, it seems it's not what I need... In fact, I want some failover of routes... can we change the routing table if a CARP VIP is free for example ? In fact, vmbr10 will never be down since it's a bridge with a virtual link to the gateway, and physical to the failover gateway... but both gateways that are fighting for the CARP VIP might be down (with my skill in opnSense that happens more often than I wish, and then this direct route is my last resort to access proxmox and rescue the situation...)
Last edited: