Code: Select all
iptables -t nat -A PREROUTING -i ethO ... # geht
iptables -t nat -A PREROUTING -i ethO:1 - ... # geht nicht
iptables -t nat -A PREROUTING -d 192.198.1.1 ... # geht nicht
iptables -t nat -A PREROUTING -i 192.198.1.1 -... # geht nicht
So sollte es mal aussehen.
IP1=exter
LAN=intern
Code: Select all
iptables -t nat -A PREROUTING -i $IP1 -p tcp --dport 80 -j DNAT --to-destination $LAN1
iptables -A FORWARD -i $IP1 -m state --state NEW -p tcp -d $LAN1 --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -i $IP2 -p tcp --dport 80 -j DNAT --to-destination $LAN2
iptables -A FORWARD -i $IP2 -m state --state NEW -p tcp -d $LAN2 --dport 80 -j ACCEPT