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 faced the following problem. There is server (Ubuntu 12.04) with two NIC that have IPs 192.168.40.147 (eth0) in 192.168.40.128/27 subnet and 192.168.40.165 (eth1) in 192.168.40.160/27 subnet. Now we have the following routing table on server:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.40.160  *               255.255.255.224 U     0      0        0 eth1
192.168.40.128  *               255.255.255.224 U     0      0        0 eth0
default         192.168.40.161  0.0.0.0         UG    99     0        0 eth1
default         192.168.40.129  0.0.0.0         UG    100    0        0 eth0

I try to ping both server IPs from 192.168.32.69 in 192.168.32.1/23 subnet and can do it only for 192.168.40.165. The other one reports "Request timed out". And if I try traceroute I can see that there is always one successful hop to the gateway (192.168.42.65) and another one either succeeds (for 192.168.40.165) or fails (for 192.168.40.147).

As I understand all ICMP packets successfully get to the server but when trying to return as soon as return address is from subnet other than 192.168.40.128/27 or 192.168.40.160/27 the resulting route will be the one of defaults. And exactly the one with the lower metric: default 192.168.40.161 0.0.0.0 UG 99 0 0 eth1. If I will swap metrics than only 192.168.40.147 address will be reachable from 192.168.32.69 host.

My question is if I can configure server in any way to allow both IPs reachable from my client host?

share|improve this question
    
Hop up to the search box in the corner, type in "policy based routing", and you will find all the answers you desire. Works great in google too :) –  NickW Oct 29 '13 at 16:46
    
If you just feel like clicking a link: serverfault.com/search?q=policy+based+routing –  NickW Oct 29 '13 at 16:47
    
Thanks, I think it will help –  revenforv Oct 30 '13 at 8:30

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.