[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: redirect apt to local repository



Thanks for the help, Alan. Lots more questions waiting for you inline if you're up for it...

Alan Chandler wrote:
On Wednesday 13 April 2005 20:35, Matt Price wrote:

now, the tricky part.  I wantto deploy this mirror in a classroom
that's not hooked up to the internet.  We will have a bunch of
computers connected to a router (running debian I reckon, actually
haven't set this bit up yet -- any suggestions?), and therefore a
local network that I hope will work fine.  The computers in the
network, though, will at some point be removed from the network and
taken into people's homes.  So I would like to LEAVE sources.list
POINTING TO http://archive.ubuntu.com , and somehow use the router to
fool the computers into thinking that they are connecting to ubuntu
when in fact they're accessing my local repository.



I actually do something like this with a router connected to the internet, but also running the internal network. In my case I get home.chandlerfamily.org.uk to point to 192.168.0.30 - you try and you will see it as my external ip address. I've changed things now, but I used hide my web server behind a NAT router, and would forward port 80 on to 192.168.0.30 a separate computer inside my network (the reason I've changed is nothing to do with this explanation).

You can easily run bind on the on the same machine as the mirror and get it to give out archive.ubuntu.com as the internal ip address of the mirror (as well as any name you want). Students in the classroom can be networked but not connected to the internet, but also be able to resolve the archive.ubuntu.com address.

So what I get is a number of machines on my local lan called xxx.home (where xxx are various winnie the pooh characters) and also home.chandlerfamily.org.uk which inside the lan resolves to the same address as webmail.home

ok, that's great. How does this work on the client side? Is it sufficient for each computer to have "xxx" in /etc/hostname (e.g., so the computer whose name is pooh.home has "pooh" in /etc/hostname)? I guess this is partly a dhcp question, see below.

Here are the relevent files in /etc/bind for my setup

=========/etc/bind/named.conf.local

zone "home" {
        type master;
        file "/etc/bind/db.home";
};


As I understand it (I've just read through the BIND manual, which I find a bit hard to follow), what you've done here is defined a zone "home"; any computer whose hostname ends in "home" belongs to this zone; and all the information about these computers is stored in the file /etc/bind/db.home . Similarly for the domains below. Is that about right?

zone "0.168.192.in-addr.arpa" {
        type master;
        file "/etc/bind/db.0.168.192";

};

You didn't include /etc/bind/db.0.168.192; is there anything interesting in that file? I poked about in the default /etc/bind/ listings and in addition to the generic magic at the top of all these files ($TTL 604800, etc) there were individual listings for each full domain name; would I need to do that explicitly?)


zone "home.chandlerfamily.org.uk" {
      type master;
      file "/etc/bind/db.home.chandlerfamily";
};

========/etc/bind/db.home
;       $Id: db.home,v 1.1 2002/11/11 16:26:10 alan Exp $
; BIND data file for local domain
;
$TTL    604800
@       IN      SOA     home. root.home. (
                             33         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      roo.home.
@       IN      MX 10   mail.home.
don't entirely understand this but I don't think it's especially important either.

; static allocation
kanger  IN      A       192.168.0.21    ;Study Workstation
pooh    IN      A       192.168.0.22    ;Breakfast Room

ok, this bit I think I understand

; below are allocated via dhcp because of compatibility at university
eeyore  IN      A       192.168.0.23    ; Emily's Portable
piglet  IN      A       192.168.0.24    ; Sarah's Portable
; Special for work portable - must be allocated by dhcp because of
; Work - it uses the mac address to find this address.
rabbit  IN      A       192.168.0.25

these I don't get. If they IP's are allocated via dhcp, how do you know in advance that they will get the address you assign here? Are you doing some kind of magic with the dhcp server?

;
tigger  IN      A       192.168.0.26    ;  Not Used (old tosh)

;
;  10-20 allocated to dhcpd clients
;
;  Default gateway - static allocation
;
roo     IN      A       192.168.0.20    ;Main machine
is this the sme machine called "main machine" below? If so is there a reason it's assigned a different IP here?
mail    IN      CNAME   roo             ;Mail is sent here
www     IN      CNAME   roo             ;Alternate name for internal web

;
;  Web Services Here
;
webmail IN      A       192.168.0.30    ;Sqweb mail
;
test    IN      A       192.168.0.39    ;Test web site

;
owl     IN      A       192.168.0.10    ;Network Gateway
wol     IN      CNAME   owl
gateway IN      CNAME   owl

gopher  IN      A       192.168.0.11    ;Wireless Router
small   IN      CNAME   gopher
wirenet IN      CNAME   gopher

========/etc/bind/db.home.chandlerfamily

;       $Id: db.home,v 1.1 2002/11/11 16:26:10 alan Exp $
; BIND data file for local domain
;
$TTL    604800
@ IN SOA home.chandlerfamily.org.uk. root.home.chandlerfamily.org
.uk. (
                              5         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      home.chandlerfamily.org.uk.
home.chandlerfamily.org.uk.     IN      A       192.168.0.30    ;Main machine

anyway, that's very helpful already. I look forward to getting this worked out! thanks,

matt


--

--------------------------
 .''`.       Matt Price
: :'  :      Debian User
`. `'` 	     & hemi-geek
  `-
--------------------------
if you're an evil spambot, these addresses are for you: aardvark@derailleur.org, zeus@derailleur.org



Reply to: