LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   iptables NAT and tun/tap interfaces (https://www.linuxquestions.org/questions/linux-networking-3/iptables-nat-and-tun-tap-interfaces-736734/)

j-osh 06-30-2009 01:20 PM

iptables NAT and tun/tap interfaces
 
I am building a proxy that I can tunnel traffic to and it will forward the traffic for me onto the Internet. The problem is that I have one physical interface "eth0" and two types of traffic on that interface. The traffic to and from the tunnel (on udp.port 8080) and the traffic to and from the internet (assumed not to be udp.port 8080).

So using iptables and the tun/tap devices I have been trying to get this to work but nothing so far has produced any results.

What I want to do is open a udp socket on port 8080 and receive all the traffic from the tunnel and then push this traffic to a tun/tap interface "tun0". Then tun0 would be the internal side of the iptables NAT and "eth0" the external side.

However, if this is done the udp.port 8080 traffic also goes through the NAT which I don't want. Can anyone give some advice and pointers on how to setup iptables to do this or even if it can be done? Also are there trick that have to be done with the Linux routing tables for this to work?


All times are GMT -5. The time now is 08:25 AM.