Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transparent Proxy for IPv6 traffic under Linux

Tags:

linux

ipv6

nat

When maintaining networks, it is often an expedient thing to do to run a transparent proxy. By transparent proxy I mean a proxy that 'hijacks' outgoing connections and runs them through a local service. Specifically I run a linux firewall with squid configured so that all tcp/ip connections fowarded on port 80 are proxied by squid.

This is achived using the iptables 'nat' table, using IPv4.

But iptables for IPv6 does not have a 'nat' table, so I cannot use the same implementation. What is a technique I can use to transparently proxy traffic for IPv6 connections?

like image 420
Jerub Avatar asked Feb 04 '23 11:02

Jerub


1 Answers

A viable way to do this is with the TPROXY rule in iptables, documentation is available here:

  • http://wiki.squid-cache.org/Features/Tproxy4#IPv6_Support
  • http://www.mjmwired.net/kernel/Documentation/networking/tproxy.txt

This should be supported Squid (>= version 3.2). Using --enable-linux-netfilter and the iptables -t mangle -j TPROXY rule.

like image 96
Jerub Avatar answered Feb 06 '23 15:02

Jerub