Here's what the NAT setup on the Cisco 3640 looks like (the NAT config on the
2501 is similar):
# set up a pool of 'public' addresses to be used by the NAT box:
# give the pool a name ('nat-pool'); give the range of addresses that defines the
# bounds of the pool; give the netmask those addresses are to interpreted relative
# to (n.b. 'prefix-length 26' is another way of saying 255.255.255.192)
ip nat pool nat-pool 12.6.230.194 12.6.230.204 prefix-length 26
# set up an access list, i.e., a rule governing access to a resource:
# give the access list an identifier ('1'); we want to allow access ('permit');
# and who we want to allow access to is everybody in 10.1.2.x (don't worry about
# the funny looking mask)
access-list 1 permit 10.1.2.0 0.0.0.255
# ok, here we go, set up the NAT:
# the guys on the inside who we're going to let out are the ones specified in
# access list '1'; the pool of public addresses we have to play with is the one
# defined in 'nat-pool'
ip nat inside source list 1 pool nat-pool overload
And here's the NAT config on the linux router
# uses the netfilter facility in the linux 2.4 kernel; we'll be working with # netfilter next trimester in connection with filtering/firewalls # # briefly: if you see a packet from 10.0.0.0/255.252.0.0 (i.e., from our 10.0, # 10.1, or 10.2 private address blocks) that's trying to get out interface # hdlc0, NAT it to a 216.114.150 number # # more verbosely: # "-t nat": netfilter maintains a number of rule tables; we want to add to # the nat one # "-A POSTROUTING": append this rule to the POSTROUTING rule list (i.e., # the (pre-defined) list of rules that are applied after # we've decided where to forward the packet to) # "-s 10.0.0.0/14 -o hdlc0": these are our match criteria--we're looking # for packets coming from certain addresses and heading out a # particular interface # "-j SNAT": the particular kind of NAT we want to do is source NAT--we # want to mangle the source address (rather than the destination # one) # "--to 216.114.150.116-216.114.150.126": when you find a packet that meets # the match criteria, swap in one of these source addresses /sbin/iptables -t nat -A POSTROUTING -s 10.0.0.0/14 -o hdlc0 -j SNAT --to 216.114.150.116-216.114.150.126
Of course, if everybody has the same gizmo--and we'll assume that the cryptographic algorithms themselves can't be kept secret--you haven't really gained anything here: if somebody intercepts the encrypted transmission they can just do what the intended recipient does to recover the original. So what we really do is feed the gizmo both the plaintext and a "key", an additional data value. The encrypted output of the gizmo is then a function of both the original message and the key, and the idea is that the recipient needs to know the key to retrieve the original (observe that this variant is really only an improvement on the previous one if the range of possible keys is large--otherwise someone could try them all). In classical ("symmetrical") cryptography, the key is a secret shared by sender and recipient.
Shared secret keys are plausible on a small scale, and where sender and recipient can have "out of channel" (e.g. face-to-face) communication. But things break down in the context of the Internet. You want to have a confidential transaction with somebody in Uzbekistan with whom you've had no prior communication. You worry about the data possibly being intercepted en route--hey, it's the Internet!--so you'd like to encrypt the communication. What to do? Send a secret key by email.. over the Internet?
Similarly if what's crucial in some communication is establishing that a message is coming from you, you can encrypt the message with your private key. If the recipient can successfully decrypt with your public key, he/she/they/it will know the message must be coming from the holder of the corresponding private key.
Of course in this last case we're dealing with authenticity but not confidentiality. Since your public key is... public, if the message is intercepted anybody can decode it. But it's possible to have your cake and eat it too: if you first encode with your private key, and then encode with the recipient's public key you get both authenticity and privacy: only the recipient can decode the doubly-encrypted message that passes over the network; only you could have sent what lies within.
What we'd like is certification by some authority (a Certificate Authority or CA); the CA vouches for the fact that some person is truly the owner of some key (presumably having done something to establish this). It does so by issuing a "digital certificate" which contains the key, the name of its owner, some other information, and... the CA's own digital signature.
So, you

next header [1 byte]
payload length [1]
reserved [2]
spi [4]
sequence number [4]
authentication data []



(source,group) (list-of-interfaces-to-forward-to)
Even routers that aren't in any current distribution trees need to maintain prune
state so they can honor graft requests.