Posts Tagged ‘how to’

RIP, a distance-vector routing protocol, works well in small networks. It sends the complete routing table to all active interfaces every 30 seconds. RIP uses hop count as its routing metric to determine the best path to in a network and has a maximum hop count of 15. It has an Administrative Distance of 20 while Static Routes has an AD of 1.

Three versions of RIP are:
RIPv1 uses classful routing, lacks support for Variable Length Subnet Masks (VLSM).
RIPv2 uses classless routing, supports Classless Inter-Domain Routing (CIDR).
RIPng an extension of RIPv2 for support of IPv6.


Configuration

1. Configure each of the router’s interfaces.

2. Configure RIP as the network’s routing protocol and add all network to be advertised.

R1(config)#router rip
R1(config-router)#network 192.168.10.0
R1(config-router)#network 192.168.10.100


R2(config)#router rip
R2(config-router)#network 192.168.100.0
R2(config-router)#network 192.168.200.0
R2(config-router)#network 192.168.20.0


R3(config)#router rip
R3(config-router)#net 192.168.200.0
R3(config-router)#net 192.168.30.0

3. Use passive-interface command to prevent RIP update broadcsts from being sent out a defined interface. The same interface can still receive RIP updates. (optional)

R1(config)#router rip
R3(config-router)#passive-interface serial 0/0

4. verify connection and routing configuration.

Ping Samples:

R1#ping 192.168.30.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.30.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/64/100 ms


R2#ping 192.168.10.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/16/36 ms

R2#ping 192.168.30.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.30.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/43/64 ms


R3#ping 192.168.10.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/64/68 ms

Routes:


R1#sh ip route
R    192.168.30.0/24 [120/1] via 192.168.100.2, 00:00:23, Serial0/0
C    192.168.10.0/24 is directly connected, FastEthernet0/0
R    192.168.200.0/24 [120/1] via 192.168.100.2, 00:00:23, Serial0/0
R    192.168.20.0/24 [120/1] via 192.168.100.2, 00:00:23, Serial0/0
C    192.168.100.0/24 is directly connected, Serial0/0


R2#sh ip route
R    192.168.30.0/24 [120/1] via 192.168.200.2, 00:00:23, Serial0/1
R    192.168.10.0/24 [120/1] via 192.168.100.1, 00:00:21, Serial0/0
C    192.168.200.0/24 is directly connected, Serial0/1
C    192.168.20.0/24 is directly connected, FastEthernet0/0
C    192.168.100.0/24 is directly connected, Serial0/0


R3#sh ip route
C    192.168.30.0/24 is directly connected, FastEthernet0/0
R    192.168.10.0/24 [120/1] via 192.168.200.1, 00:00:10, Serial0/0
C    192.168.200.0/24 is directly connected, Serial0/0
R    192.168.20.0/24 [120/1] via 192.168.200.1, 00:00:10, Serial0/0
R    192.168.100.0/24 [120/1] via 192.168.200.1, 00:00:10, Serial0/0

This is a step by step guide on how to configure BIND9 as a Primary Master Name Server.

A Primary Master Name Server reads data for a domain zone from a file located on it’s host and is authoritative for that zone. Every zone needs to have at least one DNS name server that is responsible for it. When any device on the Internet wants to know something about a zone, it consults one of its authoritative servers.

The steps will configure your name server as a Primary Master for engrdhee.com. Replace engrdhee.com with your own FQDN (Fully Qualified Domain Name).

Name Server Configuration

Step 1: Configure your Local Network.
Set up the name server’s IP configuration in /etc/network/interfaces.

Step 2: Edit host settings on the name server. Edit /etc/hosts.

[Internet address] [official hostname] [alias1]
127.0.0.1       ns1     localhost.localdomain   localhost
192.168.1.4     ns1.engrdhee.com                 ns1

/etc/hosts file contains IP addresses associated on each host names. The file is accessed by commands that use the network in the absence of a name server.

Step 3: Create a zone file on /etc/bind directory.

sudo nano db.engrdhee.com
; BIND data file for local loopback interface
$TTL    604800
@       IN      SOA     ns1.engrdhee.com. root.engrdhee.com. (
                              4         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
                        NS      ns1.engrdhee.com.

router  IN      A       192.168.1.1
ns1     IN      A       192.168.1.4
laptop          A       192.168.1.2

A zone file is a text file containing a list of all the hosts in your domain, and their corresponding IP address.
DNS records are listed at the bottom of the zone. Here’s a list of DNS records and their meaning:
SOA – Start of Authority. The record that states that this server is authorative for the specified domain.
NS – Name server: Specifies the name server to use to look up a domain
MX – Mail Exchange: Specifies mail server(s) for the domain.
A – A Record: Used for linking a FQDN to an IP address
CNAME – Canoical name: Used to assign aliases to existing A records.
PTR – Used to reveres map IP addresses to a FQDN.

Step 4: Create a reverse zone file.

sudo nano rev.1.168.192.in-addr.arpa
; BIND reverse data file for local loopback interface
$TTL    604800
@       IN      SOA     ns1.engrdhee.com. root.engrdhee.com. (
                              3         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
        IN      NS      ns1.engrdhee.com
1       IN      PTR     router.engrdhee.com
2       IN      PTR     laptop.engrdhee.com

A Reverse zone allows DNS to conversion from an address to a name.

Increment the serial every time changes are made in the zone and reverse zone file.

Step 5: Edit /etc/bind/named.conf.local.

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

zone "1.168.192.in-addr.arpa" {
        type master;
        file "/etc/bind/rev.1.168.192.in-addr.arpa";
};

The configuration will tell bind to use the files we created.

Step 6: Configure server firewall, if any.
Open port 53 to accept DNS requests. For ufw, use:

sudo ufw allow 53
sudo ufw allow bind9

sudo ufw app list will list available apps.

Step 7: Reload service.

sudo service bind9 reload

Client Configuration

Step 1: Configure each clients with their correct name server. Edit /etc/resolv.conf.

domain engrdhee.com
search engrdhee.com
nameserver 192.168.1.4
nameserver 192.168.1.1

Testing

tail -f /var/log/syslog
Output should be:

Sep 28 17:57:04 dhee-engr named[3047]: received control channel command 'reload'
Sep 28 17:57:04 dhee-engr named[3047]: loading configuration from '/etc/bind/named.conf'
Sep 28 17:57:04 dhee-engr named[3047]: reading built-in trusted keys from file '/etc/bind/bind.keys'
Sep 28 17:57:04 dhee-engr named[3047]: using default UDP/IPv4 port range: [1024, 65535]
Sep 28 17:57:04 dhee-engr named[3047]: using default UDP/IPv6 port range: [1024, 65535]
Sep 28 17:57:04 dhee-engr named[3047]: reloading configuration succeeded

Use DNS utilities, daemons and other commands to test.
e.g.:

dig engdrhee.com
nsllookup engrdhee.com
route -n 
ping engrdhee.com 
named-checkzone engrdhee.com /etc/bind/db.engrdhee.com
named-checkzone engrdhee.com /etc/bind/rev.1.168.192.in-addr.arpa
dig rev.1.168.192.in-addr.arpa. AXFR

This is a guide on how to configure BIND9 as a Caching Name Server. BIND9 is set-up as a caching name server by default.

A Caching Name Server caches a received information about a IP-address and FQDN (Fully Qualified Domain Name) mapping. It will reduce the search cost, reducing bandwidth and latency.

Name Server Configuration

Step 1: Add the IP address of your ISP’s DNS servers on /etc/bind/named.conf.options.

        forwarders {
             8.8.8.8;
             8.8.4.4;
        };

In this case, google’s public dns is used. You can replace them with your ISP’s DNS servers.

Step 2: Restart the BIND daemon.

sudo /etc/init.d/bind9 restart

Client Configuration

Step 1: Add the IP Address of your Name Server on /etc/resov.conf.

nameserver 192.168.1.2

Testing

dig -x 127.0.0.1
Output should be:

; <> DiG 9.4.1-P1 <> -x 127.0.0.1
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13427
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
[...]
;; Query time: 1 msec
;; SERVER: 172.18.100.80#53(172.18.100.80)
;; WHEN: Mon Nov 26 23:22:53 2007
;; MSG SIZE  rcvd: 93

dig google.com twice
Compare the query time. The second query time should improve. This is because your server cache the query.

1. Download the latest kernel-compatible module. Most of the files come from released tarballs. These are compressed archives with extensions like .tar.gz or .tar.bz2.

2. Install the following packages for building, in case both packages are not installed:

sudo apt-get install build-essential
sudo apt-get install linux-kernel-headers

3. Decompress the downloaded file.

tar -xzvvf tarball_name.tar.gz 
or
tar -xjvvf tarball_name.tar.bz2 

4. Go to the directory of the untarred(decompressed) source code.

cd directory

5. Build the package.

sudo make

6. Install the package.

sudo make install

7. Add the module or reboot.

sudo modprobe modulename
or
restart -r now

GNS3 for Beginners

Posted: 08/01/2011 in Cisco
Tags: , ,

GNS3 is an an open source emulation program for anyone who want to pursue a career on Cisco Routing. It’s build on dynagen and dynamips foundation.

I’ve provided you simple steps on how a topology works on GNS3:

  1. Download GNS3 from http://www.gns3.net/download.
  2. Install GNS3.
  3. Run the program and click option 1 on Setup Wizard. “Configure and test the path to Dynamips. Also check that the working directory is valid”. If you exit the Set up wizard, go to Edit | Preferences.
  4. Select a Project Directory. This is the path where your projects are saved.
  5. Select an Image directory. This is the path where IOS images are stored.
  6. Select Dynamips and click Test button. This will return a Dynamips “successfully started” message if Dynamips is running.
  7. Select option 2. Add one or more uncompressed IOS images.
  8. You have to take note of this: The IOS image in BIN format are compressed. You can load IOS image UNPACKED file for faster booting.
  9. Drag and drop devices (with IOS image) to build a topology.
  10. Add router modules (Double click the image, select the device and add slot/s on Slots Tab).
  11. Cable the connections ( Click add a link button on GNS3’s toolbar and select type of cable).
  12. Power the devices by clicking the play button on GNS3’s toolbar.

Some helpful tips:

Use the Idle PC feature to lessen the CPU usage of dynamips when the device is idle. To do this:
Right click the device, select idle PC, select the best idlepc values and select ok.

You can use wireshark captures to check packet data. To do this:
Right Click on the link between two devices, select Capture, then select a source. Go to Edit | Preferences | Capture and modify the settings to make this one work.