LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 08-21-2010, 06:47 PM   #1
sab0teur
LQ Newbie
 
Registered: Aug 2010
Posts: 5

Rep: Reputation: 0
Can I host a service on eth0 while default route is a VPN?


I am attempting to run apache on my linux router while connected to a VPN. My default route is set to the VPN endpoint and I cannot control port forwarding at that end. I cannot seem to connect to any service that i bind to the eth0 interface. I believe that my iptables rules and OpenVPN are the source of the problem.

/sbin/iptables -t nat -A POSTROUTING -o tun1 -j MASQUERADE

/sbin/iptables -A FORWARD -i tun1 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT

/sbin/iptables -A FORWARD -i eth1 -o tun1 -j ACCEPT



any ideas?
 
Old 08-21-2010, 07:11 PM   #2
sunnydrake
Member
 
Registered: Jul 2009
Location: Kiev,Ukraine
Distribution: Ubuntu,Slax,RedHat
Posts: 288
Blog Entries: 1

Rep: Reputation: 41
apache bind to selected interfaces and to 127.0.0.1 ny default you can always access it by http://machine_name or 127.0.0.1 (loopbackdevice)
if your eth0 have generic local network adderss (eg. 192.168.xxx or 10.something read RIPE ) and you not explictly added it to route table you also can always connect to this interface
post ifconfig / route before/after vpn.
 
Old 08-21-2010, 07:35 PM   #3
sab0teur
LQ Newbie
 
Registered: Aug 2010
Posts: 5

Original Poster
Rep: Reputation: 0
The goal is to be able to host a web / mail server on eth0 which is my ISP facing interface on my linux router. I need to do this while all traffic coming into eth1 is routed over tun1
 
Old 08-21-2010, 07:59 PM   #4
sunnydrake
Member
 
Registered: Jul 2009
Location: Kiev,Ukraine
Distribution: Ubuntu,Slax,RedHat
Posts: 288
Blog Entries: 1

Rep: Reputation: 41
are you sure you tryed something like ssh(or ping) eth0_ip from remote box and it doesn't work? and i need to warn you ISP sometimes block HTTP incoming port 80 i just use different ports for HTTP requests
but there is one possibility that you receive request but send answer to eth1 .. get wireshark and check

Last edited by sunnydrake; 08-21-2010 at 08:02 PM.
 
Old 08-21-2010, 08:03 PM   #5
sab0teur
LQ Newbie
 
Registered: Aug 2010
Posts: 5

Original Poster
Rep: Reputation: 0
I have checked multiple times with ncat and nmap and the port is still being filtered or not binding correctly. The ISP line is a business connection that does not filter any incoming traffic. I have a default deny stance but i explicitly allow 80 & 25.

/sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

/sbin/iptables -A INPUT -i ! lo -j DROP


/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT

/sbin/iptables -I INPUT -p tcp --dport 25 -j ACCEPT
 
Old 08-23-2010, 03:40 AM   #6
sunnydrake
Member
 
Registered: Jul 2009
Location: Kiev,Ukraine
Distribution: Ubuntu,Slax,RedHat
Posts: 288
Blog Entries: 1

Rep: Reputation: 41
if you don't know how to dump traffic on router use tcpdump and then analyze dump on machine in wireshark.
Without knowing actually what you router recive and where send reply you will shooting in the sky.
 
  


Reply

Tags
iptables, openvpn


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
non-default route to static host through gateway for ppp failover testing jrscandora Linux - Networking 3 04-21-2009 02:20 AM
Quagga default route not showing in kernel default route (netstat -nr) Valkyr1e Linux - Networking 3 08-03-2008 09:20 PM
eth0 resetting, losing default route (Vyatta) Swakoo Linux - Networking 2 07-31-2008 02:18 AM
How programatically in C do I get/set the default route or gateway address of eth0 jroberts5477 Linux - Networking 2 09-15-2006 01:11 PM
Permanently set "route add" -host and default gw sacants Linux - Newbie 1 07-18-2003 04:04 AM


All times are GMT -5. The time now is 09:52 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration