lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Question regarding how to access a linux lwip applicati


From: Sergio R. Caprile
Subject: Re: [lwip-users] Question regarding how to access a linux lwip application from outside
Date: Fri, 21 Aug 2015 11:20:37 -0300
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

How would you access any application on any machine other than the one
connected to the Internet inside your home/workplace ?
Exactly.
A tap interface is no different from another Ethernet interface, so your
Linux box will route/firewall/NAT and that is a whole adventure which is
not related to lwIP whatsoever. Forget about NAT if you run IPv6.
Assuming your box is already configured, just add the tap interface.
Otherwise, there are a lot of tutorials you'll have to follow.
The main point here, if you run IPv4, is that you'll have to configure
port forwarding so your application is seen from outside at a particular
port. You'll use private addresses for the lwIP stack.
Another problem is that the lwIP interface goes on and off with the
process, so don't expect to see it on ifconfig while lwIP is not
running; unless you configure it to stay permanent, which I don't know
how to do it. My best bet is you add your firewall rules after lwIP is
running.
In most real applications, you won't have lwIP running on your linux box
connected to the Internet but on an internal machine, so this is the
most generic recipe.

This is in no way complete and/or advisable, you better read the how-tos
and do your own math. This is how I forward a port to my son's computer
with iptables:
# forward UDP 5000 (Voobly) to Fer
iptables -t nat -A PREROUTING -i $EXTIF -p udp --destination-port 5000
-j DNAT --to-destination 192.168.69.70

EXTIF= the interface connected to the Internet.
So UDP 5000 traffic to my Internet public IP is forwarded to the same
port on an internal machine.
Replace 192.168.69.70 with your lwIP box address. You'll have two
addresses: one for the "router" and one for the "machine". Use the
"machine" address, the "router" is like an internal address for an
internal Ethernet card.

Read /contrib/ports/unix/proj/unixsim/README

When you setup your netif, the tap interface will be started and
assigned the address you set for your gw.

-- 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]