Wednesday, March 31, 2010

Make your DHCP server dynamically update your DNS records

Hi friends,

Here is the very useful blog for linux guys. We all know how to configure the DNS (bind9) server and due to name servers only we are able to resolve IPs to human readable host-names and viz. but it works in between internet and LAN network. What about LAN IPs and hosts, still we need to access them by using IP address of client machines. So here is the solution for LANs IP to hostname resolution.

Friends steps in this blog shows how to configure the DHCP server to automatically update the DNS records when giving out a new lease to a client computer. I am assuming that you already have a working copy of dhcp3-server and bind9 installed. If you don’t have that I suggest that you first read my two other blogs on how to install and configure them.

Configuration Steps :


Step 1

Apparently the Ubuntu server is installed with an AppArmor profile that prevents bind to write to the /etc/bind directory. The default profile suggests that these files should be put in /var/lib/bind. We will start by copying our zone files so we have a backup remaining if anything goes wrong:

 sudo cp /etc/bind/zones/*  /var/lib/bind/

Now change the owner and group of the files to bind, so that bind will have file permissions that allows it to write to the files:


sudo chown bind:bind /var/lib/bind/*

Step 2

We don’t want anybody to be able to update our DNS, so we need to create a secret, a key, that the DCHP server must know in order to be able to update the DNS:

sudo dnssec-keygen -r /dev/urandom -a HMAC-MD5 -b 128 -n USER DHCP_UPDATER

You can observe the generated key by:

sudo cat Kdhcp_updater.*.private | grep Key

Your key should be looking somewhat like the following key (without quotes):

"HgtB4WACBDEFGijkMZqwe=="

Now copy the key to the clipboard so that you can paste it into the configuration file later on.

Step 3

We now need to add the key to the bind configuration and tell it what zones that we want it to allow updates on. I’ve included the contents of configuration file here and marked the changes that I’ve made in bold.

Edit your /etc/bind/named.conf.local:

sudo vim /etc/bind/named.conf.local

Changes are marked with bold and red color:

#The secret key used for DHCP updates. 
key DHCP_UPDATER {
    algorithm HMAC-MD5.SIG-ALG.REG.INT;

    # Important: Replace this key with your generated key.
    # Also note that the key should be surrounded by quotes.
    secret "HgtB4WACBDEFGijkMZqwe==";
}; 
 
zone "local.domain" {
    type master;

    # Change the path of the database file to the writable 
copy in /var/lib/bind
    file "/var/lib/bind/local.domain.db";

    # Tell this zone that we will allow it to be updated 
#from anyone that knows the secret specified in the
#DHCP_UPDATER key.
    allow-update { key DHCP_UPDATER; };
};

zone "1.168.192.in-addr.arpa"  {
    type master;

    # Change the path of the database file to the
#writable copy in /var/lib/bind
    file "/var/lib/bind/rev.1.168.192.in-addr.arpa";

    # Tell this zone that we will allow it to be updated
#from anyone that knows the secret specified in the
#DHCP_UPDATER key.
    allow-update { key DHCP_UPDATER; };
};





Step 4


Now edit the your dhcps.conf so that the DHCP server can send updates to the DNS

sudo vim /etc/dhcp3/dhcpd.conf

Changes are marked with bold and red:

 
#
# Make sure to change the ddns update style to interim:
ddns-update-style interim;
ignore client-updates;      # Overwrite client configured FQHNs
ddns-domainname "local.domain.";
ddns-rev-domainname "1.168.192.in-addr.arpa.";

# option definitions common to all supported networks...
option domain-name "local.domain";
option domain-name-servers ubuntu.local.domain;

default-lease-time 600;
max-lease-time 7200;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;

# Use this to send dhcp log messages to a different log file
#(you also have to hack syslog.conf to complete the redirection).
log-facility local7;

key DHCP_UPDATER {
    algorithm HMAC-MD5.SIG-ALG.REG.INT;

    # Important: Replace this key with your generated key.
    # Also note that the key should be surrounded by quotes.
    secret "HgtB4WACBDEFGijkMZqwe==";
};

zone local.domain. {
  primary 127.0.0.1;
  key DHCP_UPDATER;
}

zone 1.168.192.in-addr.arpa. {
  primary 127.0.0.1;
  key DHCP_UPDATER;
}

# This is a very basic subnet declaration.
subnet 192.168.1.0 netmask 255.255.255.0 {
  range 192.168.1.30 192.168.1.200;
  option routers router.local.domain;
}



Step 5

The configuration files now contains our secret key. We should not let just anyone can read our secret key, so we are removing the general read rights from them:

sudo chmod o-r /etc/bind/named.conf.local
sudo chmod o-r /etc/dhcp3/dhcpd.conf


We should now have a fully working dynamic dns system for our local network, lets hold the thumbs and restart the services.

sudo /etc/init.d/bind9 restart
sudo /etc/init.d/dhcp3-server restart


Step 6

Testing :

If you have an Ubuntu client that uses DHCP you can restart its network to make the DHCP-client request a new ip-address from the server:

sudo /etc/init.d/networking restart

You should now be able to lookup your client computer in your DNS:

host lappy-ubuntu

Result:
lappy-ubuntu.local.domain has address192.168.1.30

And the reverse should now also work for your client computer address:

host192.168.1.30

Result:
30.1.168.192.in-addr.arpa domain name pointer lappy-ubuntu.local.domain.

And its done... :) now you can access any client machine by hostname only.. so there is no need to check ip address and then entering the IPs.

Hope this post will save lots of time of yourz...







Sunday, March 28, 2010

Upgrading Ubuntu versions

Hi Friends, back with a new blog for newbies...
If its a linux system then its really not a magic that you can upgrade your OS version easily to newer one, all you need is a smooth internet connection. You can do this either using command-line (which I prefer, as now 'm not much interested in watching nice graphics while installing OS) or by Update-manager.
Ok here is the procedure-


Terminal:
1. Install update-manager-core if it is not already installed:
sudo apt-get install update-manager-core
2. Launch the upgrade tool:
sudo do-release-upgrade
3. Follow the on-screen instructions.

and the version will be upgraded :)



Update Manager: 

1.  Start System/Administration/Update Manager

2. Click the Check button to check for new updates.

3. If there are any updates to install, use the Install Updates button to install them, and press Check again after that is complete.

4. A message will appear informing you of the availability of the new release.

um1

5. Click Upgrade.

6. Follow the on-screen instructions.

um5

And here is your new version upgraded.. :)

Local DNS cache for faster browsing by using dnsmasq



A DNS server resolves domain names into IP addresses. So when you request “google.com” for example, the DNS server finds out the address for the domain, and sends your request the right way.
You can run a DNS cache on your computer and can speed up the process of looking up domain names when browsing.

Install dnsmasq in Ubuntu
Dnsmasq is a lightweight, easy to configure, DNS forwarder and DHCP server. It is designed to provide DNS and optionally, DHCP, to a small network. It can serve the names of local machines which are not in the global DNS. The DHCP server integrates with the DNS server and allows machines with DHCP-allocated addresses to appear in the DNS with names configured either in each host or in a central configuration file. Dnsmasq supports static and dynamic DHCP leases and BOOTP for network booting of diskless machines.
First you need to make sure that Universe repository is enabled in your sources.list file
Install dnsmasq Using the following command

sudo apt-get install dnsmasq

uncomment the following line (remove “#” in the beginning) in the file /etc/dnsmasq.conf

listen-address=127.0.0.1

Now edit /etc/dhcp3/dhclient.conf and make sure the section below exactly like this, especially the line that says "prepend domain-name-servers 127.0.0.1;" as -

#supersede domain-name fugue.com home.vix.com;
prepend domain-name-servers 127.0.0.1;
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, host-name,
netbios-name-servers, netbios-scope;

Now open the file /etc/resolv.conf in your text editor and add "nameserver 127.0.0.1" above the all of the nameserver entries (indicated with bold)

search domainname.com
nameserver 127.0.0.1
nameserver 217.54.170.023
nameserver 217.54.170.024
nameserver 217.54.170.026

Now you need to restart the dnsmasq using the following command

sudo /etc/init.d/dnsmasq restart

Now you are running a local DNS cache.

Testing Your Local DNS Cache
If you want to measure your speed improvement, type the command
dig gmail.com

You will see something like 

;; Query time: 38 msec

Now type the command again, and you should see something like:

;; Query time: 2 msec

and its working fine :) . Hope this post will help you for faster browsing...

Thursday, February 11, 2010

Domain Name Server (BIND)

Domain Name Service (DNS) is an Internet service that maps IP addresses and fully qualified domain names (FQDN) to one another. In this way, DNS alleviates the need to remember IP addresses. Computers that run DNS are called name servers. Ubuntu ships with BIND (Berkley Internet Naming Daemon), the most common program used for maintaining a name server on Linux.

Ok lets move towards INSTALLATION procedure...

At a terminal prompt, enter the following command to install dns:

sudo apt-get install bind9
A very useful package for testing and troubleshooting DNS issues is the dnsutils package. To install dnsutils enter the following:

sudo apt-get install dnsutils
 

Now its time to configure your own DNS...

The default configuration is setup to act as a caching server. All that is required is simply adding the IP Addresses of your ISP's DNS servers. Simply uncomment and edit the following in /etc/bind/named.conf.options:

forwarders {
                  4.2.2.2;
                  5.6.7.8;
};



(Replace 4.2.2.2 and 5.6.7.8 with the IP Adresses of actual nameservers.)

Now restart the DNS server, to enable the new configuration. From a terminal prompt:

sudo /etc/init.d/bind9 restart
 
  

For the newbies.. there are 3 types of DNS servers : Cache server, Primary Master & Secondary Master.

Primary Master

In this section BIND9 will be configured as the Primary Master for the domain example.com. Simply replace example.com with your FQDN (Fully Qualified Domain Name).

Forward Zone File

To add a DNS zone to BIND9, turning BIND9 into a Primary Master server, the first step is to edit /etc/bind/named.conf.local:

zone "example.com" {
 type master;
        file "/etc/bind/db.example.com";
};
Now use an existing zone file as a template to create the /etc/bind/db.example.com file:

sudo cp /etc/bind/db.local /etc/bind/db.example.com
Edit the new zone file /etc/bind/db.example.com change localhost. to the FQDN of your server, leaving the additional "." at the end. Change 127.0.0.1 to the nameserver's IP Address and root.localhost to a valid email address, but with a "." instead of the usual "@" symbol, again leaving the "." at the end.
Also, create an A record for ns.example.com. The name server in this example:

;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     ns.example.com. root.example.com. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      ns.example.com.
@       IN      A       127.0.0.1
@       IN      AAAA    ::1
ns      IN      A       192.168.1.10

You must increment the Serial Number every time you make changes to the zone file. If you make multiple changes before restarting BIND9, simply increment the Serial once.


Once you have made a change to the zone file BIND9 will need to be restarted for the changes to take effect:

 
sudo /etc/init.d/bind9 restart

Reverse Zone File

Now that the zone is setup and resolving names to IP Adresses a Reverse zone is also required. A Reverse zone allows DNS to resolve an address to a name.
Edit /etc/bind/named.conf.local and add the following:
 
zone "1.168.192.in-addr.arpa" {
        type master;
        notify no;
        file "/etc/bind/db.192";
};



(Replace 1.168.192 with the first three octets of whatever network you are using. Also, name the zone file /etc/bind/db.192 appropriately.)


Now create the /etc/bind/db.192 file:
 
sudo cp /etc/bind/db.127 /etc/bind/db.192

Next edit /etc/bind/db.192 changing the basically the same options as /etc/bind/db.example.com:
 
;
; BIND reverse data file for local loopback interface
;
$TTL    604800
@       IN      SOA     ns.example.com. root.example.com. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      ns.
10      IN      PTR     ns.example.com.
The Serial Number in the Reverse zone needs to be incremented on each changes as well. For each A record you configure in /etc/bind/db.example.com you need to create a PTR record in /etc/bind/db.192.

After creating the reverse zone file restart BIND9:
 
sudo /etc/init.d/bind9 restart

Secondary Master

Once a Primary Master has been configured a Secondary Master is needed in order to maintain the availability of the domain should the Primary become unavailable.
First, on the Primary Master server, the zone transfer needs to be allowed. Add the allow-transfer option to the example Forward and Reverse zone definitions in /etc/bind/named.conf.local:

zone "example.com" {
                                 type master;
                                 file "/etc/bind/db.example.com";
                                 allow-transfer {
                                                         192.168.1.11;
                                 };
};

zone "1.168.192.in-addr.arpa" {
                                type master;
                                notify no;
                                file "/etc/bind/db.192";
                                allow-transfer {
                                                         192.168.1.11;
                                };
};


(Replace 192.168.1.11 with the IP Address of your Secondary nameserver.)


Next, on the Secondary Master, install the bind9 package the same way as on the Primary. Then edit the /etc/bind/named.conf.local and add the following declarations for the Forward and Reverse zones:

zone "example.com" {
                                  type slave;
                                  file "/var/cache/bind/db.example.com";
                                  masters {
                                                 192.168.1.10;
                                  };
};

zone "1.168.192.in-addr.arpa" {
                                  type slave;
                                  file "/var/cache/bind/db.192";
                                  masters {
                                                 192.168.1.10;
                                  };
};


(Replace 192.168.1.10 with the IP Address of your Primary nameserver.)


Restart BIND9 on the Secondary Master:

sudo /etc/init.d/bind9 restart



OPTIONAL :

Logging

BIND9 has a wide variety of logging configuration options available. There are two main options. The channel option configures where logs go, and the category option determines what information to log.
If no logging option is configured the default option is:

 
logging {
     category default { 
default_syslog; 
default_debug; 
};
     category unmatched { 
null; 
};
};

This section covers configuring BIND9 to send debug messages related to DNS queries to a separate file.
  • First, we need to configure a channel to specify which file to send the messages to. Edit /etc/bind/named.conf.local and add the following:

     
    logging {
        channel query.log {      
            file "/var/log/query.log";
            severity debug 3; 
        }; 
    };
  • Next, configure a category to send all DNS queries to the query file:

     
    logging {
        channel query.log {      
            file "/var/log/query.log"; 
            severity debug 3; 
        }; 
        category queries { query.log; }; 
    };
  • Since the named daemon runs as the bind user the /var/log/query.log file must be created and the ownership changed:


    sudo touch /var/log/query.log
    sudo chown bind /var/log/query.log
  • Before named daemon can write to the new log file the AppArmor profile must be updated. First, edit /etc/apparmor.d/usr.sbin.named and add:

     
    /var/log/query.log w,

    Next, reload the profile:

     
    cat /etc/apparmor.d/usr.sbin.named | sudo apparmor_parser -r
     

  • Now restart BIND9 for the changes to take effect:

     
    sudo /etc/init.d/bind9 restart
You should see the file /var/log/query.log fill with query information. This is a simple example of the BIND9 logging options.

Sunday, January 31, 2010

Network PXE-based boot


Hi Friends..!!!

This tutorial allows you to boot your machine from the network environment and select from a list of what you would like to install.

This will take more work and should also be considered intermediate to advanced. Please read through the tutorial in its entirety before diving in, researching any aspects of the tutorial you’re not familiar with prior to attempting these steps.

Requirements

There are a few things that we’ll need in order to set this up. These are outlined below:

The way that these services will be used, as a quick overview, is that the DHCP server will listen for and assign IP addresses for machines on the local network. The TFTP server will hand a small kernel and ramdisk image to the client as it boots from the network environment and the contents of the Ubuntu CD will be used to install, being shared over the web via the Apache server.

DHCP Setup

First of all we’ll install the DHCP server to initially hand out the IP addresses and point to the network boot images:

sudo aptitude install dhcp3-server

Now that we have the DHCP server installed there are a few small changes we need to make to the core configuration. Full detail on DHCP configuration is outside of the scope of this tutorial, but this should give you enough to achieve the goal of this tutorial.

We’ll first edit the DHCP configuration file, normally found in /etc/dhcpd.conf(it is better if you take a backup of this file before editing it, so that if anything goes wrong you can step back to normal condition):

sudo vim /etc/dhcp.conf

We’ll add two lines into this file outlining the address of the TFTP server (probably the same machine) and the path to the pxelinux.0 file we want to hand off to the client machines.

next-server 192.168.1.1 (the IP address of your DHCP/TFTP server)

filename "/tftpboot/pxelinux.0";

After adding these lines your dhcpd.conf file will look like this :


subnet 192.168.1.0 netmask 255.255.255.0 {

range 192.168.1.10 192.168.1.20;

next-server 192.168.1.1

filename "/tftpboot/pxelinux.0";

}



After we have made these changes we need to restart the DHCP server. We can do this using the command:

sudo /etc/init.d/dhcpd restart

Apache Setup

We need to export the contents of the CD over the web so that the network based installer can find them for use with deb. For this we’ll install apache. The base configuration should be enough for what we need here. Further details on configuring Apache are outside of the scope of this tutorial.

sudo aptitude install apache2

CD Image Contents

We’ll need to extract the contents of the CD onto the DHCP/TFTP server so that we can access the packages and the installer kernel. We can locally mount and copy the CD contents using these commands:

sudo mkdir /var/www/html/ubuntu9.10 (or, if you're going to export multiple versions select something more unique)

sudo mount -o loop CD.iso /mnt

sudo cp -a /mnt/* /var/www/html/ubuntu.910

PXELinux Setup

Now that the DHCP server knows where the tftp server is and the path to the file that it should direct clients to we need to configure the PXE end of things, which is what allows us to boot a kernel over the network or select from a list of kernels to boot over the network.

Relative to the location of the pxelinux.0 file we can make a directory for the distribution/version that we want to boot. For example we might want to install Ubuntu 9.10 so we’d create a folder U9.10, or ubuntu9.10–something to specify what version and variant this will hold.

sudo mkdir /tftboot/ubuntu9.10

We then need to copy the network-based installer kernel and initrd.gz into the newly created folder:

sudo cp /var/www/html/ubuntu9.10/install/netboot/ubuntu-installer/i386/{linux, initrd.gz} /tftboot/ubuntu9.10/

We now need to build the file that will list what is available and how to select it from a (optional) list.

pxelinux.cfg/default

We’ll now move into the /tftpboot/pxelinux.cfg directory and edit the file “default”. If this file doesn’t exist that is OK, we’ll create one.

sudo vim /tftpboot/pxelinux.cfg/default

We’ll now make a list of the boot options that might be available on this network booting system:

default 0

prompt 1

display msgs/boot.msg

# begin list of available boot options

label ubuntu9.10

kernel ubuntu9.10/linux

append initrd=ubuntu9.10/initrd.gz

This file basically outlines that a list will be presented to the user booting over the network, which we’ll create in the next step, and defines what will be loaded for each menu item.

pxelinux.cfg/msgs/boot.msg

We’ll now create a file that will give a display of the different boot options available. Your setup may only have one option outlined for installation, others might have three, four, five–a dozen different versions and variations available to install. We’ll create a list here outlining what is available and what option to enter to select the option.

This file can be something as simple as:

ubuntu9.10 - Select this to install Ubuntu 9.10

kubuntu9.10 - Select this to install Kubuntu 9.10

…etc. Creating a list such as this after having repeated the above steps for each version and variant you want to make available and you should be ready to go. One thing to note is that the boot option entered at the list prompt should match the label defined in the pxelinux.cfg/default file.

Starting The Installer

You should now be ready to install your machine by booting and instructing your machine to boot from the network. If you have trouble booting to either of those devices you might check your BIOS settings to see that one of them takes priority over the main hard drive.

You’ll be presented with a very basic menu when the netboot installer loads.

To install only the base system type ’server’, then ENTER.

For the default installation, press ENTER.

The default installation is suitable for most desktop or laptop systems.

Navigate through the installer as normal but watch for the step entitled:

Choose a mirror of the Ubuntu archive

At this step we will tell the installer to use a custom repository, in this case being the locally shared CD contents we set up previously.

Instead of selecting your country in this step go up to the first option listed: (pg-up to the top)

enter information manually

I don’t think the option of entering custom information is very intuitive so I missed this the first few times through. Watch for this step. If you are given a prompt offering us.archive.ubuntu.com or CC.archive.ubuntu.com you’ve gone too far!

The next step will prompt you for the hostname or IP address of the server you will be installing from. This is the IP address of the server you copied the CD contents and installed Apache to.

After the hostname or IP is entered the installer will prompt you for the path to the publicly shared contents. If you closely followed these steps the default entry of /ubuntu/ should work. If you copied your CD contents into a folder other than /ubuntu/ you’ll need to update this accordingly.

At this point navigate through the installer as normal and enjoy what should be faster installation speeds as network-based is usually faster than CD-based.

As I mentioned before. This should be considered more technical in nature than many of my previous tutorials. Best of luck, and enjoy network based booting and installation!

Monday, January 25, 2010

SSH without Password


Hi friends..!!

Here is the trick for how to : SSH without password so that you don't have to enter password each time you make ssh connection with the remote computer.

On your computer, open terminal and generate rsa key by firing the command-

$ sudo ssh-keygen -t rsa

(hit enter if asks for saving location so that it will take default location within .ssh/ file)

now append this generated key on destination machines authorized_keys file,

$ sudo cat .ssh/id_rsa.pub | ssh user@destination_machine_ip 'cat >> .ssh/authorized_keys'

now destination machine asks for password for one last time, enter destination machines password for the last time and now on you can ssh to your destination machine without entering the password.

Keep enjoying..!!!

Sunday, January 24, 2010

Internet Sharing Through Ubuntu


Hi all,

Back with another Blog, and a solution every Linux newbie faces, yes how to share Internet connection through ubuntu or any linux machine (if you are using your machine as a gateway for rest of the machines)

Scenario for this is, you are having a Linux machine (here its Ubuntu as I am posting this blog under Ubuntu section) with two Ethernet cards (or you can say LAN-cards or NIC's), eth0 is from where internet connection is coming from and eth1 is connected to your LAN or to another PC at your Home-Network. Simple scenario isn't it?

Ok lets start with the solution, here trick is simple, you just supposed to make "nat" (hope so you are aware of natting, if not don't worry I will publish another post describing NAT)

Firstly configure your
eth0 (means eth with internet connection)

IP add : 192.168.1.x ('x' means any IP address you want to use for your machine)
Subnet Mask : 255.255.255.0 (as its a class-C IP address)
Default Gateway : 192.168.1.1 (normally it is but if you are using any different then put that in place of and remember its your routers IP which you are using for internet connection)
Primary DNS : xxx.xxx.xxx.xxx (Put DNS provided by your ISP or you can use any open DNS like 4.2.2.2 or 4.2.2.1 and there are lots of)

now check whether you are able to ping to your default gateway and your DNS by opening your terminal from
Application --> Accessories --> Terminal and by typing

$ ping 192.168.1.1
$ ping 4.2.2.2


Now its time to configure the connection between your machine and the another machine with which you are willing to share your internet connection

for
eth1(on your machine only):
IP address : 192.168.2.1 (or any IP you want to use instead)
Subnet Mask : 255.255.255.0
Default gateway : (leave this blank as there is no need to assign it)
Primary DNS : (put DNS provided by ISP)

configure the 2nd machine accordingly and put Default gateway as IP of your 1st machine (means your own machine through which you want to share the internet connection), for example -

other machine:
IP address : 192.168.2.2
Subnet Mask : 255.255.255.0
Default gateway : 192.168.2.1
Primary DNS : (DNS provided by ISP)

this is all done with configuration, now the last step is required to complete the magic..

on 1st machine (your own machine which is going to act like a server now) add iptables rule as

$ sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

and thats it..

now you can check on 2nd computer that internet is working.


But one thing is to remember here that, the changes made in iptables till this point are temporary only, once you reboot the system all the changes you have made to iptables will be lost, next time again you have to make changes to the iptables by firing above mentioned command of NAT.

To solve this issue do the following so that changes to iptables remains unchanged after reboot

$ sudo iptables-save > /etc/iptables.up.rules

then edit /etc/network/interfaces by using your favorite editor

$ sudo vim /etc/network/interfaces

and add the line highlighted in red color, add this line just below the loopback entry


# The loopback network interface
auto lo
iface lo inet loopback
pre-up iptables-restore < /etc/iptables.up.rules

# The primary network interface
auto eth0
#iface eth0 inet dhcp

And its all done.. now the changes remains as it is after rebooting of machine..
now share and enjoy internet connection over your LAN or over your home-network.

Hope this post will help you.. if any problem persist let me know.

Thanks..!!!

Using ISO image as a repository in Ubuntu


Hi friends...!!!

I always wonder that is it really that much essential to have internet connection first if you are planning to switch to any open-source linux OS..?
If you also think like that then its totally a wrong thinking.. you can use your linux or unix OS without internet as efficiently as the user with internet connection. All you need is to know how to use your CD/DVD as a repository so that you can install applications by overcoming the dependencies...

I have recently installed Ubuntu on my machine and bad luck was the same day I was facing internet connection problem, so i was thinking that I am having all the applications i need in my DVD only so why cant I use that DVD as a Repository, and here is the procedure to how to do that...

Firstly make a ISO image of your DVD (now don't ask me how to do that..everyone knows this) and mount this image in your directory location which you want to use a path for this repository.


$ mount ubuntu_image.iso /mount/location/of/iso_image -o loop

After this make an entry in your /etc/apt/sources.list

$ sudo vim /etc/apt/sources.list

and make the following entry in it (you can add these lines anywhere in this file but try to add them at the bottom with some notations so that you easily figure-out for what purpose these entries are for)

deb file:/mounted/location/of/iso main restricted

and its done your local DVD repository is ready to server you the applications...

Hope this post will help you..