[Lazarus] FreePascal TCPIP data tunnel code sample?
Bo Berglund
bo.berglund at gmail.com
Mon Feb 8 15:56:38 CET 2016
On Fri, 5 Feb 2016 17:50:16 +0100, Koenraad Lelong
<lazarus2 at de-brouwerij.be> wrote:
>>> Isn't this just port-forwarding ? Set up the firewall to forward data to
>>> the wired NIC to the device's address and port.
>>>
>> Which firewall?
>> But you are right in the port forwarding part. I want my new RPi2 unit
>> to forward the communications on port 1001 on the Ethernet side to a
>> specific unit on the WiFi side on its 1001 port.
>>
>
>Every linux-machine, and the pi is no exception, has a firewall :
>iptables. You could configure it manually, but myself, I prefer
>shorewall to configure the firewall.
>
Well, you got me thinking and look at the RPi possibilities....
Turns out that what I want to do can be realized in the following way
without even installing or creating a program or manipulating the
Linux firewall:
On the RPi having the WiFi connection:
- Enable net.ipv4.ip_forward in /etc/sysctl.conf and reboot
On other computers in the network:
- Add a route for the WiFi network via the RPi having the WiFi
connection for example (the WiFi Pi has IP address 192.168.0.152):
On RPI:
sudo route add -net 1.2.3.0 netmask 255.255.255.0 gw 192.168.0.152
On Windows (admin command prompt):
route -4 -p ADD 1.2.3.0 MASK 255.255.255 192.168.0.152
Once I did this I could reach any IP and port in the WiFi subnet from
computers on the Ethernet network.
So I do not have to dig into making a special program for this to
work.
Thanks for getting me look for a different way of solving the problem!
--
Bo Berglund
Developer in Sweden
More information about the Lazarus
mailing list