

Now, I am reading up socket handling and message passing.
#Stunnel iptables code#
I feel Erlang code is readable like Python. I still think in loops sometimes I write counterpart in Python and port to Erlang. The uncomfortable part is writing recursive functions. Now I am getting the hang of the language. If you’re considering setting up a group chat for your community or company, try out zulip! Erlang The first time I came across the limitation of Django’s values method. I am collaborating with Arpith and Stan Zheng to add the missing feature. Unlike GitHub, zulip doesn’t support inline emoji reaction for messages. Zulip is a Python-based open source group chat. In a nutshell, those rules allow packages coming from the VPN tunnel to flow into the rest of the private network and back.This week has been quiet, bikeshedding, holiday week and unproductive week so far in RC. This line allows the traffic coming from the tunnel tun0 going to the interface wlan0, but only if a connection was established previously. Iptables -A FORWARD -i tun0 -o wlan1 -m state -state RELATED,ESTABLISHED -j ACCEPT The second line here is basically just the way back for the package. This makes the Pi accept packages on this interface and gives access to the internal network. I assume wlan0 is used as the primary internet connection in this guide, so this is main route between the router and the VPN tunnel. This line says to accept all traffic forwarded to the wlan0 interface. Iptables -A FORWARD -i wlan1 -o tun0 -j ACCEPT So you could see this as some sort of wild card. Without it, you'd need to use this command for every device connecting. It also applies masquerade, because the rule does not know the IP of the device. Then it sends the package back into the tunnel called tun0. This is why it is applied to POSTROUTING.
#Stunnel iptables how to#
This rule basically takes the package, applies NAT, but after the decision how to route this package is made. Iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE However, I cannot write a book within this answer, so I'll keep it short and simple. To understand this, you must understand the principles of routing.

Think of it as making tun0 work like the WAN port/interface of a typical consumer-grade router. This is also know as NAT (overloading) / PAT. to reach the original source address, this host should be the gateway). If this is not done, the next router would need to have return route for any response to reach the original source address. This basically mean packets that go out of tun0 would have its source address changed to tun0's. iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE Together with the former rule, essentially they mean to allow forwarding between tun0 and wlan1, as long as the connection is not initiated by a packet from tun0. This means to allow packets that comes in from tun0 to be forwarded to wlan1, only if there is related or established connection, checking with the extension/module state (it was obsoleted with conntrack, which takes the switch -ctstate instead). (Note that this is not needed for the packets to reach the address(es) of tun0 itself, as that does not count as "forwarding".) iptables -A FORWARD -i tun0 -o wlan1 -m state -state RELATED,ESTABLISHED This means to allow packets that comes in from wlan1 to be forwarded to tun0. iptables -A FORWARD -i wlan1 -o tun0 -j ACCEPT This means to allow packets that comes in from wlan0 to be forwarded (to other network via any interface on this host). Now we can look at the rules: iptables -A FORWARD -i wlan0 -j ACCEPT The rules don't make forwarding happen, but only to make exception when the default is not "ACCEPT". drop any packet that is supposed to be forwarded).

j ACCEPT rules/commands is necessary unless you have -P FORWARD DROP or similar (i.e. I have to remark that the none of the -A FORWARD. I am not going to explain very deeply (neither do I know so), but basically, under this context, what you need to know is it means the flow of packets from a host to another via this host. First of all, we need to define IP forwarding.
