# OpenVPN - how to route all client traffic?



## Shrul (Jul 11, 2012)

Hello,

*Current installation.* I've a working standard OpenVPN routed tun install, mainly following the OpenVPN 2.0 HOWTO.

It currently allows clients to connect to each other and to the server.

*Configuration change.* One of our users would like to use the server to use the VPN for web browsing, and as he often uses public wi-fi connections, I would like to honor his feature request.

*Main question.* The howto mentioned above provide instructions to route all client traffic but one of the operation requires to redirect traffic from eth0 to tun0 (on my server, this will be from em0 to tun1).

How can I do that on a server having a public IP on em0, without any pf, ipfw or other firewall currently installed? 

*Bonus question.* I've an IPv6 tunnel. How could I redirect the IPv6 traffic to gif0? If 0.0.0.0/0 is for "any IPv4", what is the syntax for "any IPv6"?


----------



## SirDice (Jul 11, 2012)

Shrul said:
			
		

> *Bonus question.* I've an IPv6 tunnel. How could I redirect the IPv6 traffic to gif0? If 0.0.0.0/0 is for "any IPv4", what is the syntax for "any IPv6"?


`# route add -inet6 default 2001:xxxx:yyyy::1`
Probably a bit better is:
`# route add -inet6 default -iface gif0`

Or in /etc/rc.conf:

```
ipv6_defaultrouter="2001:xxxx:yyyy::1"
```


----------

