How to redirect xbox from local network to tun+?

Scripts with setup, destroy, and modify routing tables and firewall rulesets for client connections.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

jergen
OpenVpn Newbie
Posts: 14
Joined: Fri Mar 27, 2015 7:37 pm

Re: How to redirect xbox from local network to tun+?

Post by jergen » Mon Mar 30, 2015 7:17 am

I think I already checked almost similar rule:

Code: Select all

iptables -A INPUT -i tun+ -j ACCEPT
iptables -A FORWARD -i tun+ -j ACCEPT
iptables -A FORWARD -i tun+ -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i eth0 -o tun+ -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.11.2 -o tun+ -j MASQUERADE
iptables -A OUTPUT -o tun+ -j ACCEPT

User avatar
maikcat
Forum Team
Posts: 4200
Joined: Wed Jan 12, 2011 9:23 am
Location: Athens,Greece
Contact:

Re: How to redirect xbox from local network to tun+?

Post by maikcat » Mon Mar 30, 2015 7:25 am

what did you tested and it didnt work?

ps: did you removed the directives you added in openvpn config?

Michael.

jergen
OpenVpn Newbie
Posts: 14
Joined: Fri Mar 27, 2015 7:37 pm

Re: How to redirect xbox from local network to tun+?

Post by jergen » Mon Mar 30, 2015 7:30 am

I tested this in the past without the rules in client openvpn config ad it did not work.
in the afternoon I'll do the same and I will inform you.

Really thank you for you help so far.

User avatar
maikcat
Forum Team
Posts: 4200
Joined: Wed Jan 12, 2011 9:23 am
Location: Athens,Greece
Contact:

Re: How to redirect xbox from local network to tun+?

Post by maikcat » Mon Mar 30, 2015 7:36 am

if your openvpn provider redirects ALL traffic via the vpn it WONT work,

you will need to use policy based routing.

Michael.

jergen
OpenVpn Newbie
Posts: 14
Joined: Fri Mar 27, 2015 7:37 pm

Re: How to redirect xbox from local network to tun+?

Post by jergen » Mon Mar 30, 2015 7:41 am

maikcat wrote:if your openvpn provider redirects ALL traffic via the vpn it WONT work,
How to check it?
In the client opencpn config I received from openvpn provider there was: "redirect-gateway def1" and I delete it.
maikcat wrote: you will need to use policy based routing.
What does it mean?

User avatar
maikcat
Forum Team
Posts: 4200
Joined: Wed Jan 12, 2011 9:23 am
Location: Athens,Greece
Contact:

Re: How to redirect xbox from local network to tun+?

Post by maikcat » Mon Mar 30, 2015 8:45 am

In the client opencpn config I received from openvpn provider there was: "redirect-gateway def1" and I delete it.
the directive you deleted IS for changing your default gateway,
meaning that your internet IS redirected via the vpn provider.
What does it mean?
google is your friend.... ;)

https://kindlund.wordpress.com/2007/11/ ... -in-linux/

Michael.

jergen
OpenVpn Newbie
Posts: 14
Joined: Fri Mar 27, 2015 7:37 pm

Re: How to redirect xbox from local network to tun+?

Post by jergen » Mon Mar 30, 2015 9:09 am

maikcat wrote:
In the client opencpn config I received from openvpn provider there was: "redirect-gateway def1" and I delete it.
the directive you deleted IS for changing your default gateway,
meaning that your internet IS redirected via the vpn provider.
What does it mean?
google is your friend.... ;)

https://kindlund.wordpress.com/2007/11/ ... -in-linux/

Michael.
Is the other solution that I will configure my own openvpn server?

jergen
OpenVpn Newbie
Posts: 14
Joined: Fri Mar 27, 2015 7:37 pm

Re: How to redirect xbox from local network to tun+?

Post by jergen » Mon Mar 30, 2015 11:32 am

Dear Maikcat,

What option in opnevpn config file is responsible for redirection of ALL traffic?

User avatar
maikcat
Forum Team
Posts: 4200
Joined: Wed Jan 12, 2011 9:23 am
Location: Athens,Greece
Contact:

Re: How to redirect xbox from local network to tun+?

Post by maikcat » Mon Mar 30, 2015 12:03 pm

in server side you should see

push "redirect-gateway def1"

in your client

redirect-gateway def1

or with def1 ommited

Michael.

jergen
OpenVpn Newbie
Posts: 14
Joined: Fri Mar 27, 2015 7:37 pm

Re: How to redirect xbox from local network to tun+?

Post by jergen » Wed Apr 08, 2015 4:06 pm

Hi Michel,

I finally installed openvpn on the vps server (freebsd). I genarated all requested keys but I have a problem to connect to it.

My idea is that the openvpn server was the easiest configured (minimalist configurations with maintaining of basic security). On the client (debian router) as you know I would like to redirect only xbox trafic to tun+ by iptables.
Could you help me again - revise my openvpn server config file and give me some tips how it should be? Thank you in advance.

Openvpn server.conf

Code: Select all

proto udp
dev tun

ca /usr/local/etc/openvpn/keys/ca.crt
cert /usr/local/etc/openvpn/keys/openvpn-client.crt
key /usr/local/etc/openvpn/keys/openvpn-client.key
dh /usr/local/etc/openvpn/keys/dh1024.pem

server 10.8.0.0 255.255.255.0
keepalive 10 120

comp-lzo no
status openvpn-status.log
verb3

Post Reply