-   Linux - Networking (
-   -   How to route 2 interface one with local GW and one with VPN on the same machine. (

Tampen 04-12-2012 09:13 AM

How to route 2 interface one with local GW and one with VPN on the same machine.
Router----------VPN-------------Desired behaviour-------ETH
----------------NO--------------all ports execpt XXXX---ETH0
DMZ-------------Yes-------------only port XXXX----------ETH1

ETH0 192.168.1.XX uses GW to acces internet.
ETH1 192.168.1.XY uses VPN to acces internet (DMZ in local router).

So I want help how to route the traffic for port XXXX on the machine.
All traffic on port XXXX both incoming and outgoing should go trough ETH1, ETH1 is connected to an VPN and is DMZ in the router.
ETH0 is going to have all other ports on it and it is not connected to any VPN.

Is this somehow plausible? And how? Will be very happy for any help with it.

Best Regards

nikmit 04-13-2012 07:18 AM

I think it is pretty much the same solution.

Tampen 04-19-2012 05:08 AM

I will try that solution as soon as i get time next week. Will get back if it work's or not. Thank's.

Tampen 04-25-2012 09:18 AM

Tried that solution must have done something wrong because when I try it the computer loses all connection to the outside world.

To simplify the question eth0 should have all internal traffic 192.168.1.X and eth 1 all traffic from internet.
ETH1 is going to be DMZ and connected to an VPN as gateway. ETH0 is going to have as gateway. Both interfaces is connected to the same network and router with static IP.

Mayde soem IP tables configuration would help to?

ourfirst 04-25-2012 11:18 PM

maybe you should use iptables to add some rules.

iptables -A INPUT -i eht1 -p tcp -m tcp xxxx -j DROP
iptables -A INPUT -i eth0 -p tcp -m tcp xxxx -j ACCPET
iptables -A INPUT -i eht0 -j DROP

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