Skip to contentSkip to conversation

Connecting from Internet to a system behind a NAT on a LAN possible ?

DISCUSSION Marc Rechté 2 participants 2 messages Feb 21, 2004

lore
Share & tools
lore
#0 lore raw

A LAN is equipped with an Internet gateway using NAT to share the one IP address assigned by the ISP. The problem is to be able from Internet to connect to one of the interfaces located on the LAN (which local IP addresses are unknown from Internet).

Can netfilter help to solve such a problem ?

Many thanks for your help.

Marc.

#1 lore raw

Yes. with DNAT in the PREROUTING chain in the nat table.

ex fowarding tcp/25 connectios an the public address into 192.168.1.2 in the LAN

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -P FORWARD ACCEPT
iptables -t nat -A PREROUTING -s local.ip.from.theisp -p tcp --dport 25 -j DNAT --to 192.168.1.2:25

and it should be working.

Hello Marc,

Saturday, February 21, 2004, 9:26:20 AM, you wrote:

MR> A LAN is equipped with an Internet gateway using NAT to share the one IP MR> address assigned by the ISP. The problem is to be able from Internet to MR> connect to one of the interfaces located on the LAN (which local IP MR> addresses are unknown from Internet).

MR> Can netfilter help to solve such a problem ?

MR> Many thanks for your help.

MR> Marc.

Signature · 2 lines
Best regards,
 Alexis                            mailto:[email protected]