Note that there are some explanatory texts on larger screens.

plurals
  1. POwith iptables forwarding port to other client but with recognition of original sender ip
    primarykey
    data
    text
    <p>I have a firewall (based on iptables) at dedicated ubuntu server. I have several LAN Clients.</p> <p>At one of my LAN Clients I am running software where I can restrict acces based on IP. For me it is important that I can restrict that by using WAN IPs so not LAN IPs.</p> <p>I have configured my firewall so that a/one port is forwarded to a LAN client which work good (solution found at stackoverflow). So far no problems.</p> <p>However at the LAN client I do not see the IP of external sender but - I think due to the forwarding - the client sees that the packet is coming from my LAN server.</p> <p>Question is: how to forward a port on my server to another LAN IP with different port, but so that the LAN client recognizes the external IP of the packet.</p> <p>Lets make it more clear:</p> <p>server LAN IP: 192.168.1.10 server port: 8080</p> <p>should be forwarded to: client LAN IP: 192.168.1.20 client LAN port: 8000</p> <p>With iptables I have:</p> <pre><code>iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 8080 -d 192.168.1.10 -j DNAT --to 192.168.1.20:8000 iptables -A FORWARD -p tcp -d 192.168.1.20 --dport 8000 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT iptables -t nat -A POSTROUTING -p tcp --dport 8000 -d 192.168.1.20 -j SNAT --to 192.168.1.10 </code></pre> <p>As written that works, but when f.i. someone at IP 88.77.66.55 sends a packet then my LAN client (192.168.1.20) sees that the packet is coming from my LAN server (192.168.1.10) and unfortunately not from 88.77.66.55.</p> <p>Can I fix that...?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload