iptable based routing with Hamachi
I have Hamachi installed on my server at home and my laptop at work, the goal is to route web traffic via Hamachi too my server at home which will act as the gateway.
I have set up the routes on the server, the iptables, and it will route anything coming from the Hamachi interface on to the internet, tested this and it works fine. I have a routing table called 200 hamachi in rt_tables and I then run this script to set it up. Code:
ip route flush table 200 I am using Debian 8 (3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u2 (2016-01-02) x86_64 GNU/Linux) its like the iptables are not changing the packet but after researching this it does appear that the iptables are correct and possible something else I am missing? |
If the system in question is a router, then the above should work.
However, if you want to route locally generated traffic, you will have to use the OUTPUT chain of the mangle table to mark the packets. See table 6.2 on this page for details regarding relevant tables and chains for handling locally generated traffic. |
Cool, that worked, the script now looks like this
Code:
ip route flush table 200 |
Ok, got this fully working now with this script
Code:
#!/bin/bash Thank you for the help |
All times are GMT -5. The time now is 09:37 PM. |