LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-16-2015, 05:55 PM   #1
rossi141
LQ Newbie
 
Registered: Sep 2015
Posts: 3

Rep: Reputation: Disabled
How can I force all local network traffic through gateway?


Hi All - I am trying to figure out how I can force all traffic from my devices through my gateway without changing my IP addressing scheme. What I have come up with is as follows:

Change my "link" route so that it points to my gateway for local traffic.
Change this:
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.2
To this:
192.168.0.254/32 dev eth0 proto kernel scope link src 192.168.0.2

I have done this manually, and it works exactly as I wanted it to. Now for the question. How can I propagate this to my devices? Is there any way using DHCP to push this?
If not, other than using rc.local (which will not survive a ifdown/up), is there any way that I can make this change permanent on my devices?

Maybe someone knows a different way to force this to happen?

Any assistance is greatly appreciated.

Cheers
Rossi
 
Old 09-16-2015, 10:03 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,027

Rep: Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632
Someone may have a better solution but I might be tempted to use a proxy.pac file maybe if you want to push it over dhcp.

Many apps still don't like proxy.pac but for web pages it seems to be OK.
 
Old 09-17-2015, 04:41 AM   #3
rossi141
LQ Newbie
 
Registered: Sep 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks for the thought - Unfortunately, I need all traffic to be affected (including things like ICMP).
 
  


Reply


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
How to force the network machines to use the local DNS and the proxy? THpubs Linux - Networking 1 09-29-2014 10:32 PM
LXer: How to force all network traffic through Tor on Fedora LXer Syndicated Linux News 0 08-21-2013 05:11 PM
Force TCP traffic out over specific interface when IP is bound to another local NIC yeager Linux - Networking 7 08-17-2010 09:16 AM
[SOLVED] Iptables firewall and gateway for local network not working. Mogget Linux - Networking 4 03-12-2009 12:41 AM
Using openSUSE 10.2 as a gateway for a local network karnaf SUSE / openSUSE 8 05-30-2007 06:24 PM

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

All times are GMT -5. The time now is 01:18 PM.

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