Myatu
05-12-2010, 12:28
Originally Posted by keyjey
iptables -A PREROUTING -t nat -i eth0 -p tcp --source 94.23.237.9 --dport 25 -j DNAT --to 10.0.10.11:25
iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -o eth0 -j SNAT --to --to 91.1.2.3
iptables -A PREROUTING -t nat -i eth0 -p tcp --source 91.1.2.3 --dport 80 -j DNAT --to 10.0.10.1:80
auto vmbr2 iface vmbr2 inet static address 10.0.0.1 netmask 255.0.0.0 bridge_ports dummy0 bridge_stp off bridge_fd 0 post-up /etc/pve/kvm-networking.sh
auto eth0 iface eth0 inet static address 10.0.0.2 # whatever you'd like in the 10.x.x.x range netmask 255.0.0.0 gateway 10.0.0.1
iptables -A PREROUTING -t nat -i eth0 -p tcp --source MY.HO.ST.IP --dport 80 -j DNAT --to 10.0.0.2:80
iptables -A INPUT -p tcp -m state --state NEW --dport 80 -i eth0 -j ACCEPT
auto vmbr2 iface vmbr2 inet static address 10.0.0.1 # ... existing, etc ... post-up /sbin/iptables-restore < /etc/iptables.conf
iptables-save > /etc/iptables.conf
auto lo iface lo inet loopback iface eth0 inet manual auto vmbr0 iface vmbr0 inet static address MY.HO.ST.IP netmask 255.255.255.0 gateway MY.HO.ST.254 broadcast MY.HO.ST.255 bridge_ports eth0 bridge_stp off bridge_fd 0 network MY.HO.ST.0 auto vmbr1 iface vmbr1 inet manual bridge_ports dummy0 bridge_stp off bridge_fd 0 post-up /etc/pve/kvm-networking.sh