3.3. IP Addresses and Routing¶
The Synthetic Internet listens on many thousands of IP addresses to make the traffic look like there are many machines comprising the set of servers.
3.3.1. Realism¶
In general, no attempt is made to match our IP addresses to real world addresses. For example, we have not distributed our servers across IPs that match to particular geographic distributions that one would expect in the real Internet.
One notable exception to that is that we use the actual IPs of the root name servers for DNS. This is to facilitate integrating our DNS with other systems, as the root DNS addresses are well known and many systems are preconfigured to contact those addresses.
3.3.2. Adding an IP¶
To add another IP address to those the SI is listening on use the following command (using IP 1.2.3.4 as an example):
ip addr add 1.2.3.4/32 dev lo
Note that the netmask for this is /32
. Regardless of the network
the address actually uses, this should always be the netmask if adding
it to lo
because Linux systems will actually answer for any address
in any network on that device. That is, if you add 1.2.3.4/24
the system would also answer for 1.2.3.5
and the rest of the IPs
in that network.
We use lo
so that the configuration does not need to know which NIC
is expected to be used. Even when the IP is on a different device than
the one physically connected, the Linux kernel will still answer it.
3.3.2.1. Making it persistent¶
Add a line to either /usr/local/tg/etc/IP_fakes
or any file
(including adding a new one) in /usr/local/tg/etc/ipfakes
which are
the files that are loaded when the system starts. The format for these
lines is the IP and netmask followed by the device to load it on. As
mentioned above, to avoid needing to know about the way the machine is
deployed, we typically use a /32
netmask and load everything on the
loopback device, lo
. To make the address in the above example
persistent use the following line:
1.2.3.4/32 lo
3.3.3. Routing¶
The stock configuration of SI does not speak any routing protocol. Instead, the SI is generally configured to be the default route at the end of the rest of the routing cloud. If no other router knows how to deliver it, send it to the SI.
That does mean that the SI needs to know how to route all of its traffic back to the proper destination, as it cannot have a default route. If it does have a default route the router and the SI will get stuck bouncing undeliverable packets back and forth until the TTL expires.
Configuring permanent routes does require deployment specific
information. Unlike the IPs as above, we do not rely on lo
nor do
we use any special tools. Instead, we use the capabilities of the
system by adding needed routes to
/etc/sysconfig/network-scripts/route-<dev>
as needed. Those are
automatically loaded when <dev>
is loaded. Each device can have
its own set of routes for when that device is brought up.
The format of this file is similar to the arguments used with the
ip route add
command. That is, it’s <network> via <router>
.
For example, to route to the 25.94.104/24
network via a router at
192.168.222.4
add the following line to the file:
25.94.104/24 via 192.168.222.4