TJMNQ Gateways

Background

The gateways act as both a router and a print server.

They usually consist of a PC that has:

The gateway will be directly connected to an ADSL modem. In almost all cases, Mackay is the exception, the modem will be in bridge mode. This means that the modem does nothing more than convert Ethernet frames into xDSL frames. It is up to the gateway to setup the PPP link to the ISP. This includes authentication.

In the case of Mackay, the gateway will simply sit in between the modem/router and the rest of the LAN.

TJMNQ Gateway computers are now only used a means of communicating to the PDEs/Printers

Setting up a gateway computer

  1. Install linux. Almost all distro/version should be fine. Should install updates
  2. Create ccc user. Password should be the same as the other gateways.
  3. Edit the following line in  /etc/sysconfig/network 

    HOSTNAME=<location>_gw
  4. # cd /etc/sysconfig/network_scripts
  5. Edit the file  ifcfg-<external interface>  to include the following lines

    ONBOOT=YES
    BOOTPROTO=dhcp
    IPADDR=192.168.1.1
    NETMASK=255.255.255.0
  6. Edit the file  ifcfg-<internal interface>  to include the following lines

    ONBOOT=YES
    BOOTPROTO=static
    IPADDR=192.168.1.2
    NETMASK=255.255.255.0
  7. Edit  /etc/hosts 

    # All the .tjm.com.au addresses are public IP
    # (which are usually not accessible, other than ssh)
    165.228.233.119         cairns.tjm.com.au
    165.228.233.106        mtisa.tjm.com.au
    165.228.226.142          townsville.tjm.com.au
    165.228.5.40            darwin.tjm.com.au
    # The VPN addresses are only for gateway machines
    192.168.201.1           townsville_gw head-office.vpn
    192.168.201.2           cairns_gw cairns_gw.vpn
    192.168.201.3           mtisa_gw mtisa_gw.vpn
    192.168.201.4           darwin_gw darwin_gw.vpn
    192.168.201.5           mackay_gw mackay_gw.vpn
  8. Setup the VPN to townsville_gw. See http://robin.crecom.com.au/knowledge/linux/vpn%20setup.htm

  9. Edit  /etc/ppp/ip-up.local 

    echo 1 > /proc/sys/net/ipv4/conf/<internal interface>/proxy_arp
    route del townsville.localnet gw townsville_gw
    route add townsville.localnet gw townsville_gw
  10. Setup the firewall. Copying Darwin's firewall and editing the appropriate variables should be enough.
  11. Setup the printers:
    • invoice - Network printer. Needs overlay
    • invoicep - Network printer. Plain paper
    • label - Parallel printer. Zebra TLP2824
  12. Setup cups-lpd. This is needed so that LPD (Control server in Townsville) can talk to CUPS on the gateway.
    1. Install Cups-Lpd. For Fedora Core 6,
      # yum install cups-lpd
    2. Edit  /etc/xinet.d/cups-lpd 

      disable = no
    3. Restart xinetd
      # /etc/init.d/xinetd restart
  13. Setup the printers in Control server (Townsville)
    1. Add the following to  /etc/printcap.local 

      <location>_invoice:\
              :lp=:rm=<location>_gw:rp=invoice:sd=/var/spool/lpd/<location>_invoice:
      <location>_invoicep:\
              :lp=:rm=<location>_gw:rp=invoicep:sd=/var/spool/lpd/<location>_invoicep:
      <location>_label:\
              :lp=:rm=<location>_gw:rp=label:sd=/var/spool/lpd/<location>_label:
    2. Restart Lpd
      # /etc/init.d/lpd restart
    3. Add the new printers to Control
      > prnaad
  14. Setup the netserial
    1. Transfer a copy of netserial from another TJMNQ gateway. It should be located in  /usr/local/bin/ 

    2. Edit  /etc/inittab 

      ns0:2345:respawn:/usr/local/bin/netserial 4001 19200,n,8,1 >> /var/log/netserial.log 2>&1
    3. Reload inittab
      # init q
    4. Setup the <location>_pde printer in Control (Townsville)

      (Townsville)> prnaad
  15. Test EVERYTHING !!

TJMNQ_gateway (last edited 2013-09-18 06:09:34 by localhost)