Combining dual identity routing and isolated interfacesIn theory, combining dual identity routing with isolated interfaces should be simple. However, it turns out that there is a small trick to it. This came up today because I am in the process of migrating my office machine from one network to another. This means that I currently have three active interfaces on the machine (old IP address, new IP address, and an internal network), plus one end of a GRE tunnel, and as part of the migration I wanted to force the routing to work right, just in case. The problem with the straightforward combination is that it will try to force locally generated packets from one of the machine's IP addresses out the appropriate network interface even if it is talking to the other end of the GRE tunnel. This is unlikely to work very well; at the best it will bounce off the gateway router and come right back. The solution is to steal packets for the GRE tunnel before they get
handled by the source IP address rules. Usefully, the isolated
interfaces part of this has already defined
a routing table with exactly the right IP addresses in it. So we
write the
As a useful side effect, this makes it possible for me to fully test the firewall rules protecting the internal network, since now my machine is willing to actually route packets through the firewall. (I am tempted to package the Alas, I am now left with a mystery: according to the policy routing
rules, it looks like a packet from IP1 to an address on that subnet
should get routed via the gateway (and similarly for the other
networks), as the (I just checked and the explicit rule to steal GRE tunnel traffic is necessary; without it the packets get shoved out on eth0 instead.) Important update, November 20th: it turns out that I was wrong and packets from IP1 to the subnet were getting routed via the gateway. See DualIdentityIsolationII for the fix. |
These are my WanderingThoughts GettingAround This is part of CSpace, and is written by ChrisSiebenmann. * * * Atom feeds are available; see the bottom of most pages. Categories: links, linux, programming, python, snark, solaris, spam, sysadmin, tech, unix, web |