Basically what i want to do is:

~$ ip addr add dev eth0
~$ ip route add dev eth0
~$ ip route add default via

what i tried is: /etc/systemd/network/wired.network



when i tried ip route there is no output. What have i done wrong and what is the correct way to do this ?

  • The solution to this question works for me. serverfault.com/questions/667319/…. However i cant understand it. – user385274 Nov 11 '16 at 15:16
  • In theory, that isn't possible, but it has been done in practice. The idea of a gateway is that it is the network address in your network to where traffic destined for a different network gets sent. if the gateway address is in a different network, your address should not know how to get to the gateway address because it is on a different network. Basically, to get to a different network, you use the gateway, but the gateway is on a different network, so you must use the gateway to get to itself. – Ron Maupin Nov 11 '16 at 15:49
  • @Shankar this works because a Point to Point network literally only has one place to send packets to. So it just sends them to the other end of the link and crosses its fingers that the receiver knows how to deal with it. This has been done on some networks I've read about that run /31 or /32 everywhere on ethernet links, essentially eliminating L2. But it also usually involves running a routing daemon on each node. The exception is Point-to-point protocols like, uuh, PPP (which stands for Point to Point Protocol). It's very common on DSL connections. – Mark Henderson Nov 11 '16 at 15:55

Gateway= try with GatewayOnLink= in route section it should work. https://www.freedesktop.org/software/systemd/man/systemd.network.html#GatewayOnlink=

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy