Last active
November 24, 2024 22:23
-
-
Save miladrahimi/b6a1c1f6849ea3b63a0a4af55e1b86cc to your computer and use it in GitHub Desktop.
Set Up Debian Server As A Router with NAT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 1 > /proc/sys/net/ipv4/ip_forward | |
iptables -t nat -A POSTROUTING -o ens192 -j MASQUERADE | |
iptables -A INPUT -i ens224 -j ACCEPT | |
iptables -A INPUT -i ens192 -m state --state ESTABLISHED,RELATED -j ACCEPT | |
iptables -A OUTPUT -j ACCEPT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file describes the network interfaces available on your system | |
# and how to activate them. For more information, see interfaces(5). | |
source /etc/network/interfaces.d/* | |
# The loopback network interface | |
auto lo | |
iface lo inet loopback | |
# The primary network interface | |
allow-hotplug ens192 | |
iface ens192 inet static | |
address 78.157.40.163/29 | |
gateway 78.157.40.161 | |
# dns-* options are implemented by the resolvconf package, if installed | |
dns-nameservers 8.8.8.8 8.8.4.4 | |
dns-search vm01 | |
# The private network interface | |
auto ens224 | |
iface ens224 inet static | |
address 192.168.0.1/24 | |
# gateway 192.168.1.1 | |
# dns-* options are implemented by the resolvconf package, if installed | |
dns-nameservers 8.8.8.8 8.8.4.4 | |
# dns-search vm01 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
but.. we're at nftables now.