iptables: Internal port forwarding with fwmark and routing tables

view story

http://serverfault.com – I have 2 servers and I need to forwart to internal port. To explain I use the server with 2 interfaces (internal/external) as server A and the internal server as server B. In server A i use iptables -A PREROUTING -t nat -i $extif -p tcp --dport $extif_port -j DNAT --to-destination $dst_ip:$dst_port" iptables -A FORWARD -t filter -d $dst_ip -j ACCEPT" iptables -A POSTROUTING -t nat -p tcp -s $dst_ip --sport $dst_port -j SNAT --to-source $extif_ip" And in the server B I use a fwmark and routing to the server A using fwmark and iproute2: ip rule $command fwmark 1 lookup 1 ip route $comman (HowTos)