Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a computer with two network interfaces, say eth0 and eth1 with IPes 192.168.1.10 and 192.168.1.11 respectively. Both these interfaces are connected to a router directly.

When I send traffic to 192.168.1.11 from 192.168.1.10 (or let Linux 'choose' interface itself), due to default entries in linux local routing table, traffic would never leave for the network and would get routed internally. How can I delete these entries from local routing table and add in some other routing table such that traffic for 192.168.1.11 is forced out to the router.

There must be some "ip" or "iptables" way which I couldn't' figure out.

share|improve this question
    
Do you have an actual reason for wanting to do this? –  Michael Hampton Sep 14 '13 at 12:49
    
you might get what you want by removing the route to 192.168.1.11 from the local table (ip route del 192.168.1.11/32 table local) and explicitly adding it with the router as the gateway to the default routing table. But I suspect this would break more than it could ever fix. –  the-wabbit Sep 14 '13 at 23:12

1 Answer 1

Have you tried ip r del ... and ip r add ...?

Anyway please post ip r output to be sure you properly explain the case.

share|improve this answer
    
More of a comment than a answer –  Drew Khoury Sep 15 '13 at 1:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.