multigateway routing for details src port

I have 2 portal to accessibility net, in some way I intend to load stabilizing it, until now its working, yet some link or solution require relentless portal IP to be made use of, so the customer needs to never ever transform its portal once it have actually attached to dest., my existing execution appears to be round-robin or whatever it is.

this is my iproute

...
...
default
    nexthop via 192.168.1.1 dev eth0 weight 1
    nexthop via 192.168.1.2 dev eth0 weight 1
.

currently i intend to repair it in some way the portal the customer will make use of is determined, as an example by utilizing resource port, if the resource port is also number we make use of gw.1 and also weird number experience gw.1, can we do that making use of ip route?

* note that I just have one outgoing user interface : eth0 below.

0
2019-05-06 02:18:49
Source Share
Answers: 1

Use plan routing with noting packages. I'm not exactly sure what layout of arrangement it is yet you need to examine it in your distro.

In commandline it need to resemble (not examined yet need to function)

iptables -A PREROUTING -t mangle -p tcp --dport 22 --set-mark 0x1 -j CONNMARK
echo "200 ssh" >> /etc/iproute2/rt_tables
ip rule add fwmark 1 table ssh
ip route add default dev eth0 via 192.168.1.2 table ssh

Edit : lines

echo "200 ssh" >> /etc/iproute2/rt_tables

Names routing table 200 by name "ssh". It is maintained in between boots.

0
2019-05-08 16:44:32
Source