Previous: , Up: How-to   [Contents][Index]

2.7 Scenario 6: add a NAT server

Notice: By NAT we mean this third server should be located on a private network. It access the internet via the second server as gateway, but cannot be accessed from outside of his private network.

Network configuration example:

 hostname2$ cat /proc/net/dev
 eth0 ... (internet)
 eth1 ... (private network)
 hostname2# echo 1 > /proc/sys/net/ipv4/ip_forward
 hostname2# iptables -t nat -A POSTROUTING -s -o eth0 \
                           -j MASQUERADE
  hostname3# ping (ok)
hostname1# ping HOSTNAME3 (ko: Destination Host Unreachable)

Join collection with the third server as we seen previously (Scenario 5).

Edit the configuration on both second and third server:

 hostname2$ cat /etc/mediatex/mdtx.conf
networks   private1, www
gateways   private1
  hostname3$ cat /etc/mediatex/mdtx.conf
networks   private1
 hostname2$ mediatex upgrade
  hostname3$ mediatex upgrade

With this settings, the second server will relay queries and contents between the first and the third server: (see notify)

Checking it:

First, share the ex-cd2 support with the collection on hostname3.

  hostname3$ mediatex add supp ex-cd2 on \
  hostname3$ mediatex add supp ex-cd2 to coll hello

Once first server have reloaded, it will notify queries to the second server (via CRON) which will relay them to the third one.

hostname1$ mediatex upgrade
hostname1$ mediatex srv notify

PUBLISHER on hostname3 is now asked to provide the supports it shares.

  hostname3$ mediatex motd
  hostname3$ mediatex check supp ex-cd2 on \

Once third server notify, second server will copy (and extract) the files needed by server 1.

  hostname3$ mediatex srv notify
 hostname2$ mediatex srv extract
 hostname2$ ls ~mdtx/cache/mdtx-hello/logo*

Finally second server notify and then first server copies the requested file and delivers a mail to advice the USER it becomes available.

 hostname2$ mediatex srv notify
hostname1$ mediatex srv extract

Previous: , Up: How-to   [Contents][Index]