LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to make tun0 my only IP seen by all hosts (https://www.linuxquestions.org/questions/linux-networking-3/how-to-make-tun0-my-only-ip-seen-by-all-hosts-904481/)

shaggyrol 09-22-2011 02:19 PM

How to make tun0 my only IP seen by all hosts
 
Hi everyone

I have a RHEL 6 system connected to internet on interface wlan0, and i have a VPN that generates interface tun0. My tun0 interface is an american IP ,but my local IP (wlan0) is not, so at the time i try to open US exclusive sites, it detects the IP on my wlan0 interface, If im sure my tun0 has a US IP, how can i set my network config so web sites will see my tun0 IP instead. was thinking on iptables, but not sure how to achive it

pingu 09-23-2011 03:25 AM

You can do that by changing the routing table.
Easiest is to set tun0 to default gateway:
# route del default
#route add default tun0
(not 100% sure about the syntax here)

If you only want some traffic through tunnel you'll have to set the route for those ip ranges.
Never used RHEL, surely it has some admin tools fpr manipulating routing table?


All times are GMT -5. The time now is 09:45 PM.