Skip to content

Instantly share code, notes, and snippets.

@naufdotal
Last active February 6, 2018 16:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naufdotal/9b23a422bd12a1316ea0d38424096305 to your computer and use it in GitHub Desktop.
Save naufdotal/9b23a422bd12a1316ea0d38424096305 to your computer and use it in GitHub Desktop.
networking kimsufi 1 ip NAT (/etc/network/)
# network interface settings; autogenerated
# Please do NOT modify this file directly, unless you know what
# you're doing.
#
# If you want to manage part of the network configuration manually,
# please utilize the 'source' or 'source-directory' directives to do
# so.
# PVE will preserve these directives, but will NOT its network
# configuration from sourced files, so do not attempt to move any of
# the PVE managed interfaces into external files!
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 91.121.xx.xxx
netmask 255.255.255.0
gateway 91.121.xx.254
broadcast 91.121.xx.255
iface eth0 inet6 static
address 2001:41d0:0001:8***::1
netmask 128
dns-nameservers 2001:41d0:3:163::1
post-up sleep 5; /sbin/ip -family inet6 route add 2001:41d0:0001:89ff:ff:ff:ff:ff dev eth0
post-up sleep 5; /sbin/ip -family inet6 route add default via 2001:41d0:0001:89ff:ff:ff:ff:ff
pre-down /sbin/ip -family inet6 route del default via 2001:41d0:0001:89ff:ff:ff:ff:ff
pre-down /sbin/ip -family inet6 route del 2001:41d0:0001:89ff:ff:ff:ff:ff dev eth0
auto vmbr0
iface vmbr0 inet static
address 10.10.10.1
netmask 255.255.255.0
network 10.10.10.0
bridge_ports none
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s 10.10.10.0/24 -o eth0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s 10.10.10.0/24 -o eth0 -j MASQUERADE
#
# Forward NAT IP Private 10.10.10.3 port 3389 to IP Public port 8123
#
post-up iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 8123 -j DNAT --to-destination 10.10.10.3:3389
post-down iptables -t nat -D PREROUTING -i eth0 -p tcp -m tcp --dport 8123 -j DNAT --to-destination 10.10.10.3:3389
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment