0

What is the recipe for adding a second gateway/route for the second public ip that the machine has for systemd-networkd (on the single interface that is used)? This is Alma9/systemd-252 L.E. to clarify the setup: we have 2 distinct public networks, that both have a common egress device (L3 switch, our vlan with the exit ips + the other side vlan, static routing) For the purpose of monitoring, i have a machine that have on the same interface an ip from each network (to be able to directly ping local machines from both networks); recently we begun to feel the need to ping external reference points from both networks (to test the different paths that the networks are routed outside of our control) So, with different source ips, i would like to ping an external ip. for this, i need to tell (in networkd language) the system that for the x.x.x.x source there is a default route, but if the source is y.y.y.y the next hop is y.y.y.1

3
  • It depends on how your provider has their network configured. Commented Nov 8, 2023 at 9:34
  • could you elaborate please? i forgot to mention that it's about 2 different networks the we have, each with it's own gateway. The intent is to have on this machine also outside connectivity when for an application i specify as a source ip the second network Commented Nov 8, 2023 at 9:42
  • You'll have to edit your question to describe the problem in more detail. There's many ways to do multiple IP's, dependent on how the network is configured and what you want to achieve. Commented Nov 8, 2023 at 10:10

1 Answer 1

0

The working solution was to define

[ROUTE] Gateway=GW_IP1 Metric=0 [ROUTE] Gateway=GW_IP2 Metric=100 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.