LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to route 2 interface one with local GW and one with VPN on the same machine. (http://www.linuxquestions.org/questions/linux-networking-3/how-to-route-2-interface-one-with-local-gw-and-one-with-vpn-on-the-same-machine-939445/)

Tampen 04-12-2012 08: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 192.168.1.1 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 06:18 AM

See http://www.linuxquestions.org/questi...erface-939475/
I think it is pretty much the same solution.

Tampen 04-19-2012 04: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 08: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 192.168.1.1 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 10: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 11:22 PM.