LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-22-2011, 02:19 PM   #1
shaggyrol
LQ Newbie
 
Registered: Mar 2010
Posts: 5

Rep: Reputation: 0
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
 
Old 09-23-2011, 03:25 AM   #2
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
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?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables question with OpenVPN (tun0 to tun0 filtering) fang0654 Linux - Server 3 09-30-2009 02:17 AM
Iptables/TC: how to make masqueraded traffic go through an openVPN tun0? theVOID Linux - Networking 3 04-25-2008 03:34 AM
Sendmail: How to make only users in hosts can send to mailing lists? batbayar Linux - Server 3 05-08-2007 01:22 AM
make changes in hosts.allow active true_atlantis Linux - Networking 1 04-18-2006 04:20 PM
How do I make BIND override arbitrary hosts? davidgro Linux - Networking 4 05-13-2005 02:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration