Hallo zusammen,
ich hoffe, hier ist jemand fit in dem Thema NAT/IPTables.
Also mein Setup ist sehr nah an diesem hier:
Bei mir kommt nach der pfsense zwar noch ein Nginx Proxy Manager der das alles aufteilt, aber das sollte in diesem Fall keine Rolle spielen.
DATEN:
Haupt-IP: 162.55.131.56
Zweit-IP: 162.55.131.58
Also mein Ziel ist es gerade, dass ich eine VM über die zweite IP erreichbar mache. Dazu habe ich vmbr2 erstellt und die Netzwerkkarte entsprechend zugewiesen. Leider scheint das ganze nicht wirklich zu funktionieren.
Meine Vermutung ist das ich die zweite IP irgendwie bei dem NAT ausschließen muss?
Code: /etc/network/interfaces
# network interface settings; autogenerated
# Please do NOT modify this file directly, unless you know what
# you're doing.
#
# If you want to manage parts of the network configuration manually,
# please utilize the 'source' or 'source-directory' directives to do
# so.
# PVE will preserve these directives, but will NOT read its network
# configuration from sourced files, so do not attempt to move any of
# the PVE managed interfaces into external files!
source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback
iface lo inet6 loopback
auto enp7s0
iface enp7s0 inet manual
#Netzwerkkart
iface eth0 inet manual
auto vmbr0
iface vmbr0 inet static
address 10.0.0.1/30
bridge-ports none
bridge-stp off
bridge-fd 0
post-up iptables -t nat -A POSTROUTING -s '10.0.0.0/30' -o vmbr2 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.0.0.0/30' -o vmbr2 -j MASQUERADE
#DMZ Network
auto vmbr1
iface vmbr1 inet static
address 192.168.100.2/24
bridge-ports none
bridge-stp off
bridge-fd 0
#Interne Netzwerk
auto vmbr2
iface vmbr2 inet static
address 162.55.131.56/26
gateway 162.55.131.1
bridge-ports enp7s0
bridge-stp off
bridge-fd 0
up ip route add 162.55.131.58/32 dev virbr1
down ip route del 162.55.131.58/32 dev virbr1
up route add -net 162.55.131.0 netmask 255.255.255.192 gw 162.55.131.1 dev vmbr2
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A PREROUTING -i vmbr2 -p tcp -m multiport ! --dport 22,8006 -j DNAT --to 10.0.0.2
post-up iptables -t nat -A PREROUTING -i vmbr2 -p udp -j DNAT --to 10.0.0.2
#route 162.55.131.0/26 to
Alles anzeigen
vHost
Code: /etc/network/interfaces
# 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 ens18
iface ens18 inet static
address 162.55.131.58/32
gateway 162.55.131.56
netmask 255.255.255.255
pointtopoint 162.55.131.56
Alles anzeigen
Bildquelle:
Proxmox auf Rootserver mit nur 1 Public IP-Addresse + pfSense - NAT IPTables
Proxmox auf Rootserver Proxmox VE betreiben und alles über Virtuelle Maschinen managen. Das alles mit nur 1 IP-Adresse.
schroederdennis.de