LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Route traffic to certain IP addresses out a certain network interface (https://www.linuxquestions.org/questions/linux-networking-3/route-traffic-to-certain-ip-addresses-out-a-certain-network-interface-939475/)

cati 04-12-2012 10:25 AM

Route traffic to certain IP addresses out a certain network interface
 
Hello, all! I have a desktop with an ethernet connection to a private, internal network and a wireless connection to a public, external network. I want to make sure only connections to 10.*.*.* goes over the private interface and all other traffic goes over the public interface. The private interface can route traffic out to the external network, but I don't want it to.

I am familiar with route and iptables, but I don't see anything in the man pages about how to do this. How can I implement this?

nikmit 04-13-2012 04:06 AM

ip route add 0.0.0.0/0 dev wlan0
ip route add 10.0.0.0/8 dev eth0

Just change the interface names to match yours.
Nice reference for the ip set of commands at http://linux-ip.net/gl/ip-cref

cati 04-13-2012 08:51 AM

Thanks!


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