Separate networks take a lot of work to configure and administer, although an increasing number of firewall products are available that may ease the labor. The problem is to bridge the various pieces of software to cause it to work via an intermediate machine, in this case the bastion host. It is difficult to be more specific without going into unwieldy detail, but HTTP, for instance, can be bridged by running an HTTP proxy and configuring the browser appropriately, as we saw in Chapter 9. These days, most software can be made to work by appropriate configuration in conjunction with a proxy running on the bastion host, or else it works transparently. For example, Simple Mail Transfer Protocol (SMTP) is already designed to hop from host to host, so it is able to traverse firewalls without modification. Very occasionally, you may find some Internet software impossible to bridge if it uses a proprietary protocol and you do not have access to the client’s source code.
SMTP works by looking for Mail Exchange (MX) records in the DNS corresponding to the destination. So, for example, if you send mail to our son and brother Adam[7] at adam@aldigital.algroup.co.uk, an address that is protected by a firewall, the DNS entry looks like this:
# dig MX aldigital.algroup.co.uk ; <<>> DiG 2.0 <<>> MX aldigital.algroup.co.uk ;; ->>HEADER<<- opcode: QUERY , status: NOERROR, id: 6 ;; flags: qr aa rd ra ; Ques: 1, Ans: 2, Auth: 0, Addit: 2 ;; QUESTIONS: ;; aldigital.algroup.co.uk, type = MX, class = IN ;; ANSWERS: aldigital.algroup.co.uk. 86400 MX 5 knievel.algroup.co.uk. aldigital.algroup.co.uk. 86400 MX 7 arachnet.algroup.co.uk. ;; ADDITIONAL RECORDS: knievel.algroup.co.uk. 86400 A 192.168.254.3 arachnet.algroup.co.uk. 86400 A 194.128.162.1 ;; Sent 1 pkts, answer found in time: 0 msec ;; FROM: arachnet.algroup.co.uk to SERVER: default -- 0.0.0.0 ;; WHEN: Wed Sep 18 18:21:34 1996 ;; MSG SIZE sent: 41 rcvd: 135
What does all this mean? The MX
records have
destinations (knievel and
arachnet) and priorities (5 and 7). This means
“try knievel first; if that
fails, try arachnet.” For
anyone outside the firewall, knievel always
fails, because it is behind the firewall[8] (on
Inside and Inbetween), so
mail is sent to arachnet, which does the same
thing (in fact, because knievel is one of the
hosts mentioned, it tries it first then gives up). But it is able to
send to knievel, because
knievel is on Inbetween.
Thus, Adam’s mail gets delivered. This mechanism was
designed to deal with hosts that are temporarily down or with
multiple mail delivery routes, but it adapts easily to firewall
traversal.
This affects the Apache user in three ways:
[7] That is, he’s the son of one of us and the brother of the other.
[8] We know this because one of the authors (BL) is the firewall administrator for this particular system, but, even if we didn’t, we’d have a big clue because the network address for knievel is on the network 192.168.254, which is a “throwaway” (RFC 1918) net and thus not permitted to connect to the Internet.