Isolating network interfaces on LinuxConsider a not entirely hypothetical situation: you have an office machine that serves as one end of a GRE tunnel, and, in addition to its official network interface, has a fluctuating number of secondary interfaces on various internal VLANs for testing, debugging, and so on. The simple approach for such a machine is to just turn on global IP forwarding and cross your fingers that no one will decide to make the machine their gateway (apart from the GRE link). But this is not ideal; if nothing else, it may alarm coworkers that you have an unofficial router on the network. What we really want to do is to isolate the secondary interfaces, making
it so that we won't forward their packets and we won't forward packets
to them for other people. The first part is selective IP forwarding; just turn forwarding on only for For my office machine, I decided to simplify things by declaring that
the GRE tunnel was allowed to reach everything and thus only traffic
from
(Here R is the remote IP and Next we need some rules to restrict
Translated, this drops any traffic from This is not complete isolation, because we have not given the machine a dual identity for its own traffic. In my situation this is basically harmless, so I haven't gone to the extra effort. |
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 |