Skip to content

Instantly share code, notes, and snippets.

@gnanet
Created January 30, 2015 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gnanet/02ed769c45ca722bf2a1 to your computer and use it in GitHub Desktop.
Save gnanet/02ed769c45ca722bf2a1 to your computer and use it in GitHub Desktop.
Snippet for Hetzner Root server with multiple IP address in the same subnet
iface eth0 inet static
address $ETH0
netmask 255.255.255.224
# network $NW
broadcast $BC
post-up ip route add $GW/32 dev eth0 src $ETH0 table mainip
post-up ip route add default via $GW dev eth0 table mainip
post-up ip rule add from $ETH0 table mainip
# post-up ip route add default scope global nexthop via $GW dev eth0
post-down ip rule del from $ETH0 table mainip
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 213.133.98.98 213.133.99.99 213.133.100.100 8.8.8.8
iface eth2 inet static
address $ETH2
netmask 255.255.255.224
# network $NW
broadcast $BC
post-up ip route add $GW/32 dev eth2 src $ETH2 table gstatic
post-up ip route add default via $GW dev eth2 table gstatic
post-up ip rule add from $ETH2 table gstatic
post-down ip rule del from $ETH2 table gstatic
# dns-nameservers 213.133.98.98 213.133.99.99 213.133.100.100 8.8.8.8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment