Skip to contentSkip to conversation

Local Routing without IP Aliasing

DISCUSSION Jim Doble 2 participants 2 messages Jul 17, 2006

lore
Share & tools
lore

Jim Doble

author
#0 lore raw

I am trying to configure a Linux host to treat a potentially large range of IP addresses as "local", without having to define these addresses as aliases. When packets (UDP or TCP) arrive addressed to any of these addresses, I need these packets to be delivered locally (that is, treated as if they were addressed to the IP address of my Linux host, even though they were not), without losing knowledge of the original destination address and port. I am defining static routes in any other hosts that need to communicate with these addresses, in order to ensure that packets addressed to these addresses will be sent to my Linux host. The problem I am having is that these packets are being discarded in my Linux host, unless I redirect them to the address associated with my Linux host, in which case the original destination address is lost (except in the case of TCP, where there is a mechanism to recover it via getsockopt).

I would prefer to find a way to do this using iptables or routing configuration, or via a netfilter extension, if that is possible. Any advice would be appreciated.

Jim Doble
Tavve Software Company

#1 lore raw

Hello,

Quoted 1 line · Jim Doble

I am trying to configure a Linux host to treat a potentially large range of IP addresses as "local", without having to define these addresses as aliases.

ip route add local <prefix>/<length> dev lo