Servus,
ich habe meinem Server eine zweite IP gegönnt. Die zweite IP soll ein Mailserver werden. Laut dem was mir das Interface des Providers sagt sollte ich dies in die /etc/network/interfaces eintragen:
Alles mit eth0 und vmbr0 zu tun hat funktioniert. eth1 und vmbr1 leider nicht, sieht hier jemand meinen Fehler?
Danke
SW
ich habe meinem Server eine zweite IP gegönnt. Die zweite IP soll ein Mailserver werden. Laut dem was mir das Interface des Providers sagt sollte ich dies in die /etc/network/interfaces eintragen:
Code:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 152.54.82.136/22
gateway 152.54.82.1
auto eth1
iface eth1 inet static
address 152.54.172.70/32
auto vmbr0
iface vmbr0 inet static
address 10.10.10.1/24
bridge-ports none
bridge-stp off
bridge-fd 0
auto vmbr1
iface vmbr1 inet static
address 10.10.20.1/24
bridge-ports none
bridge-stp off
bridge-fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
# Regeln für eth0
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
post-up iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to-destination 10.10.10.100:80
post-down iptables -t nat -D PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to-destination 10.10.10.100:80
post-up iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j DNAT --to-destination 10.10.10.100:443
post-down iptables -t nat -D PREROUTING -i eth0 -p tcp --dport 443 -j DNAT --to-destination 10.10.10.100:443
post-up iptables -A FORWARD -p tcp -d 10.10.10.100 --dport 80 -j ACCEPT
post-down iptables -D FORWARD -p tcp -d 10.10.10.100 --dport 80 -j ACCEPT
post-up iptables -A FORWARD -p tcp -d 10.10.10.100 --dport 443 -j ACCEPT
post-down iptables -D FORWARD -p tcp -d 10.10.10.100 --dport 443 -j ACCEPT
post-up iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1
# Alles was auf eth1 reinkommt → VM 10.10.20.200
post-up iptables -t nat -A PREROUTING -i eth1 -j DNAT --to-destination 10.10.20.200
post-down iptables -t nat -D PREROUTING -i eth1 -j DNAT --to-destination 10.10.20.200
# Rückweg
post-up iptables -t nat -A POSTROUTING -s 10.10.20.200 -o eth1 -j SNAT --to-source 152.54.172.70
post-down iptables -t nat -D POSTROUTING -s 10.10.20.200 -o eth1 -j SNAT --to-source 152.54.172.70
# Forwarding hin und zurück
post-up iptables -A FORWARD -i eth1 -d 10.10.20.200 -j ACCEPT
post-up iptables -A FORWARD -s 10.10.20.200 -o eth1 -j ACCEPT
post-down iptables -D FORWARD -i eth1 -d 10.10.20.200 -j ACCEPT
post-down iptables -D FORWARD -s 10.10.20.200 -o eth1 -j ACCEPT
# Proxmox Connection Tracking Fix
post-up iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1
Alles mit eth0 und vmbr0 zu tun hat funktioniert. eth1 und vmbr1 leider nicht, sieht hier jemand meinen Fehler?
Danke
SW