Build your own gateway for your private network
Setting up a gateway on your private network is required if your machines only have private addresses.
NAT — Network Address Translation
auto ens2
iface ens2 inet static
address 10.1.1.1/24sudo sh -c 'echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf'
sudo sysctl -p#!/usr/sbin/nft -f
flush ruleset
table ip nat {
chain POSTROUTING {
type nat hook postrouting priority 100;
oifname "ens1" masquerade
}
}
table ip filter {
chain FORWARD {
type filter hook forward priority 0; policy drop;
iifname "ens1" oifname "ens2" ct state related,established accept
iifname "ens2" oifname "ens1" accept
}
}Trying out a client
DHCP – Dynamic Host Configuration Protocol
Reconfigure a client machine to use the DHCP server
Last updated
Was this helpful?