Showing posts with label Computer Networking. Show all posts
Showing posts with label Computer Networking. Show all posts

Wednesday, May 22, 2013

Configuring DNS/Bind Server on RedHat 6



nano /etc/hosts


192.168.0.101 www.sourav.com
192.168.0.101 www.test.com
192.168.0.101 redhatserver.sourav.com
192.168.0.101 redhatserver.test.com
nano /etc/resolv.conf

search sourav.com

nano /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"
HWADDR="00:0C:29:46:0C:5A"
NM_CONTROLLED="no"
BOOTPROTO="STATIC"
ONBOOT="yes"
IPADDR=192.168.0.101
NETMASK=255.255.255.0
BROADCAST=192.168.0.255
NETWORK=192.168.0.0
GATEWAY=192.168.0.201
DNS1=192.168.0.101
DOMAIN=sourav.com

emacs /etc/named.conf


options {
# make it comment ( listen all interfaces on the server )
#listen-on port 53 { 127.0.0.1; };
#change ( if not use IPv6 )
listen-on-v6 { none; };
directory "/var/named";
forwarders { 8.8.8.8;4.2.2.2; };
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
# query range ( set internal server and so on )
allow-query {
localhost;
192.168.0.0/24;
};
# transfer range ( set it if you have secondary DNS )
#allow-transfer { localhost; 192.168.0.0/24; };
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

# change all from here

view "internal" {
        match-clients {
                localhost;
                192.168.0.0/24;
        };
        zone "." IN {
                type hint;
                file "named.ca";
        };
        zone "sourav.com" IN {
                type master;
                file "sourav.com.fwd";
                allow-update { none; };
        };
        zone "0.0.10.in-addr.arpa" IN {
                type master;
                file "0.168.192.rev";
                allow-update { none; };
        };
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
};




nano /var/named/sourav.com.fwd



$TTL 86400
@   IN  SOA     redhatserver.sourav.com. root.sourav.com. (
        2013051001  ;Serial
        3600        ;Refresh
        1800        ;Retry
        604800      ;Expire
        86400       ;Minimum TTL
)



    IN         NS        redhatserver.sourav.com.


    IN         A         192.168.0.101



    IN       MX    10      redhatserver.sourav.com.



redhatserver       IN      A          192.168.0.101


emacs /var/named/0.168.192.rev


$TTL 86400
@   IN  SOA     redhatserver.sourav.com. root.sourav.com. (
        2013051001  ;Serial
        3600        ;Refresh
        1800        ;Retry
        604800      ;Expire
        86400       ;Minimum TTL
)



     IN      NS        redhatserver.sourav.com.



     IN      PTR       sourav.com.
     IN       A       255.255.255.0



    101        IN      PTR       redhatserver.sourav.com.




/etc/rc.d/init.d/named restart

Apache Server Configuration with Name Based Hosting in RedHat Linux 6

My Configuration,

Operating System  :  redhat 6.3 32bit server
Hostname          :  redhatserver.sourav.com
IP Address        :  192.168.0.101
Client Details:

Operating System  :  redhat 6.3 32bit Desktop
Hostname          :  client.sourav.com
IP Address        :  192.168.0.10


Prerequisites:

1. Set the hostname of redhatserver server

[root@redhatserver ~]# vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=redhatserver.sourav.com
2. Add the redhatserverserver hostname in ‘etc/hosts’ file

[root@redhatserver ~]# vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.250   redhatserver.sourav.com
192.168.1.250   www.sourav.com
3. Install Apache

Check and remove any previously installed packages
[root@redhatserver ~]# rpm -qa | grep httpd
or
[root@redhatserver ~]# yum list installed | grep httpd
Now install the ‘httpd’ package
[root@redhatserver ~]# yum install httpd* -y
4. Configure Apache

[root@redhatserver ~]# vi /etc/httpd/conf/httpd.conf
## line no 262 - Set the server admin mail id which is used to receive mail generated by apache ##
ServerAdmin root@sourav.com
## line no 276 - Set the redhatserversite name ##
ServerName www.sourav.com:80
## line no 292 - Set the redhatserver pages folder ##
DocumentRoot "/var/www/html"
## line no 402 - Sent the index or home page of the redhatserversite ##
DirectoryIndex sourav.html
5. Create a sample index or home page

Create the index or home page html file in the ‘/var/www/html/’ directory
[root@redhatserver ~]# vi /var/www/html/sourav.html


 Welcome to sourav redhatserversite 

6. Allow redhatserverserver through firewall

[root@redhatserver ~]# vi /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
Restart iptables to save changes
[root@redhatserver ~]# service iptables restart
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Unloading modules:                               [  OK  ]
iptables: Applying firewall rules:                         [  OK  ]
7. Start Apache redhatserver server

[root@redhatserver ~]# service httpd start
Starting httpd:                                            [  OK  ]
[root@redhatserver ~]# chkconfig httpd on
Client side Configuration

1. Add the redhatserverserver and client ip address and hostname in the ‘/etc/hosts’ file

[root@client ~]# vi /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.251   client.sourav.com
192.168.1.250   www.sourav.com
 for name based hosting

VirtualHost *:80
    # This first-listed virtual host is also the default for *:80
    ServerName www.example.com
    ServerAlias example.com
    DocumentRoot /www/domain
/VirtualHost

VirtualHost *:80
    ServerName other.example.com
    DocumentRoot /www/otherdomain
/VirtualHost

You can alternatively specify an explicit IP address in place of the * in VirtualHost directives. For example, you might want to do this in order to run some name-based virtual hosts on one IP address, and either IP-based, or another set of name-based virtual hosts on another address.

Many servers want to be accessible by more than one name. This is possible with the ServerAlias directive, placed inside the VirtualHost section. For example in the first VirtualHost block above, the ServerAlias directive indicates that the listed names are other names which people can use to see that same redhatserver site:

ServerAlias example.com *.example.com

use name based hosting

uncomment the next line

NameVirtualHost *:80


install elinks browser

rpm -ivh elinks*

then from terminal

elinks www.sourav.com
elinks www.test.com

Saturday, March 9, 2013

Static route and persistent route in server 2008


Add a static route 

by command line

route add 192.168.163.0 mask 255.255.255.0 192.168.163.2

we can see this route by the command

route print

but this route will be temporary as after restart it will be gone

so delete the route by

route delete 192.168.163.0

now add the route as a persistent route

route -p add 192.168.163.0 mask 255.255.255.0 192.168.163.2

or go to server manager,roles,network policy ..,routing and remote..,ipv4,static routes and add a route 

static route works much better than a default gateway,you can make the default gateway blank and use static routing  

Enable ping and remotely managing the firewall of server 2008 core


to enable ping(icmp) reply on server 2008 core

netsh firewall set icmpsetting 8

and then you should be able to ping  server 2008 from a remote machine

to enable remote firewall administration in server core

netsh advfirewall set currentprofile settings remotemanagement enable

then go to the remote machine

mmc-add remove snap in-windows firewall with advanced security-manage another computer,put the ip address of server 2008 core there and you will see all the firewall option like inbound rule etc there 




Install and configure DHCP server on server 2008 core


start /w ocsetup DHCPServerCore

sc config dhcpserver start= auto

net start dhcpserver

(because the dhcp service will be started automatically from next time)

to authorize dhcp server

netsh dhcp add server servercore.sourav.com 192.168.10.60

to show the dhcp servers on the network

netsh dhcp show server

now we can manage the dhcp server on server 2008 core remotely from a GUI

to do that we have to first restart the server 2008 core (otherwise it didn't work for me at least)

now we can go a different pc,mmc-add remove snap in,dhcp.add server,put the ip of server 2008 core and then you can configure the scope etc... 

Tuesday, March 5, 2013

How to join server 2008 core to a domain





netdom join %computername% /domain:sourav.com /userd:administrator@sourav.com /passwordd:*** /reboot:60

How to rename server 2008 core

netdom renamecomputer %computername% /newname servercore

Set static ip address and dnsserver in server 2008 core

netsh interface ipv4 set address name="Local Area Connection" source=static address=192.168.10.60 mask=255.255.255.0 gateway=192.168.10.101


set dnsserver by

netsh interface ipv4 add dnsserver name="Local Area Connection" address=8.8.8.8 index=1   (index1 for primary,add secondary by index=2)   and you are done!!!

Configure dhcp on server 2008 core

netsh interface ipv4 set address "Local Area Connection" dhcp

ipconfig /renew

and you are done!!!

Sunday, February 24, 2013

Joining Domain using netdom


This worked for me in server 2008 domain.


Netdom join \\server2 /Domain:sourav.com /UserD:administrator /PasswordD:****  /reboot:15

Tuesday, December 4, 2012

DHCP configuration file in CentOS 5

It is  /etc/dhcpd.conf  in CentOS 5

The commented out lines are for address reservation.


#
# DHCP Server Configuration file.
#   see /usr/share/doc/dhcp*/dhcpd.conf.sample 




ddns-update-style interim;
allow booting;
allow bootp;
ignore client-updates;

set vendorclass=option vendor-class-identifier;

subnet 10.10.1.0 netmask 255.255.255.0 {

option routers 10.10.1.1;
option domain-name-servers 192.168.163.2;
option subnet-mask 255.255.255.0;
range 10.10.1.15 10.10.1.25;
filename "/pxelinux.0";
default-lease-time 21600;
max-lease-time 43200;
next-server 10.10.1.1;
}



#host  client {

#hardware-ethernet 00:0C:29:BC:55:9C ;
#fixed-address  10.10.1.15;
#}









Sunday, December 2, 2012

Configure Cisco ASA 8.4 in GNS 3 step by step



 Download the ASA 8.4 files for GNS3 from this link


http://www.mediafire.com/download.php?l010dd0c1nayf0d

Now configure ASA under QEMU in GNS 3 like this

Qemu Options: -vnc none -vga none -m 1024 -icount auto -hdachs 980,16,32

Kernel cmd line: -append ide_generic.probe_mask=0x01 ide_core.chs=0.0:980,16,32 auto nousb console=ttyS0,9600 bigphysarea=65536






activation-key 0x4a3ec071 0x0d86fbf6 0x7cb1bc48 0x8b48b8b0 0xf317c0b5

activation-key 0xb23bcf4a 0x1c713b4f 0x7d53bcbc 0xc4f8d09c 0x0e24c6b6

source:http://www.xerunetworks.com/2012/02/cisco-asa-84-on-gns3/

Tuesday, November 27, 2012

Thursday, August 16, 2012

Some info about OSPF

OSPF uses hello protocol


In OSPF Hello messages are sent every 10(some people tune it,make it even 2 seconds) seconds on broadcast/point to point networks and every 30 seconds on NBMA(Non Broadcast Multi Access such as Frame Relay) Networks

Hello message contains information such as

Router ID(name of the router)

Hello and Dead Timers(how often they are saying and this has to match between the neighbours)

Network Mask(subnet mask and this has to match between the neighbours)

Area ID(the area they are in and this has to match between the neighbours)

Neighbours(they have to match)

Router Priority

DR/BDR IP Adress

Authentication Password(this has to match)

Brief Intro on Link State Protocols

Link State Routing protocols


Forms different relationship rather than sending broadcasts in a periodic interval

After the exchange of initial routing table ,routers send small event based updates


Example OSPF and IS-IS

Advantages of link state protocols

Much Faster to converge

No Routing Loops

Forces you to design your network correctly


Disadvantages of Link State Routing

Takes heavy resources on routers

Requires a solid network design

Technical Complexity

Distance vector protocols and their issue of looping

Distance vector Routing Protocols send entire table at specific intervals


Distance vector protols are simple to implement but they have looping issues,count down to infinity issue

There are 5 loop prevention mechanism in Cisco Routers

1.Maximum Distances(For RIP it is 16 hops,if any network is 16 hops away it's not considered anymore,)

2.Route Poisoning(advertise that the network is down immediately,they kill the network by sending the network a maximum hop count bigger than 16 so that the maximum distance law takes the network out)


3.Triggered Updates(send the update immediately rather than waiting 30 sec like RIP generally does,poison the route,and tell the neighbour device that the network is down,triggered idea should be avoided in an unstable network where interfaces are going up and down)

4.Split Horizon(tell routers do not send updates/advertisements in the same direction you recieved them)

5.Hold Down Timer(it won't believe any other updates about a particular route for a cirtain amount of time,180 sec is typical,works great in a situation where interfaces are going up and down)

Wednesday, March 21, 2012

Some great youtube channels as your resource

http://www.youtube.com/user/VambarInc/videos



http://www.youtube.com/user/sipurhadash/videos



http://www.youtube.com/user/ccie12933/videos



http://www.youtube.com/user/techhindiguru/videos



http://www.youtube.com/user/routergods/videos



http://www.youtube.com/user/Keith6783/videos



http://www.youtube.com/user/JKC327/videos



http://www.youtube.com/user/packetlab/videos



http://www.youtube.com/user/cgermany77/videos



http://www.youtube.com/user/alibukai/videos



http://www.youtube.com/user/ciscotoot/videos



http://www.youtube.com/user/danscourses/videos



http://www.youtube.com/user/CovertSecOps/videos



http://www.youtube.com/user/astorinonetworks/videos



http://www.youtube.com/user/nhancedlearning/videos



http://www.youtube.com/user/Keith6783/videos



http://www.youtube.com/user/GNS3Vault/videos



http://www.youtube.com/user/nicholasclaygolden/videos



http://www.youtube.com/user/AnythingOverIP/videos



http://www.youtube.com/user/ibc111/videos



http://www.youtube.com/user/TrainSignalInc/videos



http://www.youtube.com/user/nicholasclaygolden/videos



http://www.youtube.com/user/networkingstepbystep/videos



http://www.youtube.com/user/classiqueheart/videos



http://www.youtube.com/user/Viperboy0323/videos



http://www.youtube.com/user/classiqueheart/videos



http://www.youtube.com/user/ubuntudevelopers/videos



http://www.youtube.com/user/omgubuntu/videos



http://www.youtube.com/user/bsdtutorial/videos



http://www.youtube.com/user/cwade12c/videos

http://www.youtube.com/user/thisweekinlinux/videos



http://www.youtube.com/user/LinuxSpatry/videos



http://www.youtube.com/user/sneekylinux/videos



http://www.youtube.com/user/Raja221/videos



http://www.youtube.com/user/usrlocal/videos





http://www.youtube.com/user/SecuritronLinux/videos



http://www.youtube.com/user/linuxjournalonline/videos



http://www.youtube.com/user/KingHerring/videos



http://www.youtube.com/user/gotbletu/videos



http://www.youtube.com/user/beginusinglinux/videos



http://www.youtube.com/user/TheLinuxVideo/videos



http://www.youtube.com/user/UbuntuHelpGuy/videos



http://www.youtube.com/user/PuppyLinuxWorld/videos



http://www.youtube.com/user/LinuxSpatry/videos



http://www.youtube.com/user/OhHeyItsLou/videos



http://www.youtube.com/user/RedHatVideos/videos



http://www.youtube.com/user/programmerslab/videos



http://www.youtube.com/user/ctsdownloads/videos



http://www.youtube.com/user/thejoesteiger/videos



http://www.youtube.com/user/tech4fric/videos



http://www.youtube.com/user/CCNAVIDEO

http://www.youtube.com/user/thegns3/videos



http://www.youtube.com/user/ChRiStIaAn008/videos



http://www.youtube.com/user/whatscrackinfoo/videos



http://www.youtube.com/user/bsdpunk/videos



http://www.youtube.com/user/SchoolFreeware/videos



http://www.youtube.com/user/FearedBliss/videos



http://www.youtube.com/user/frvfilms/videos



http://www.youtube.com/user/UbuntuHelpGuy/videos



http://www.youtube.com/user/MrLinuxLive/videos



http://www.youtube.com/user/FischundCoProduction/videos



http://www.youtube.com/user/Jakejw93/videos



http://www.youtube.com/user/tedboy1977/videos



http://www.youtube.com/user/LinuxNativeGaming/videos



http://www.youtube.com/user/dodderysteam/videos



http://www.youtube.com/user/thejoesteiger/videos



http://www.youtube.com/user/MetalShreader/videos



http://www.youtube.com/user/UbuntuHelpGuyBlogs/videos



http://www.youtube.com/user/centrify/videos



http://www.youtube.com/user/hungarianunixportal/videos



http://www.youtube.com/user/platnumX/videos



http://www.youtube.com/user/cwade12c/videos



http://www.youtube.com/user/essayboard/videos



http://www.youtube.com/user/bubblyonline/videos



http://www.youtube.com/user/davidranum/videos(for python)



http://www.youtube.com/user/bbentendre/videos(coding)



http://www.youtube.com/user/VoidRealms/videos(coding)



http://www.youtube.com/user/thenewboston/videos(coding)



http://www.youtube.com/user/TheKurtPrice/videos(coding)



http://www.youtube.com/user/WwwAtoZMastiCom/videos(coding)



http://www.youtube.com/user/category5tv/videos(ubuntu)



http://www.youtube.com/user/MrGizmo757/videos(ubuntu)



http://www.youtube.com/user/MicroHelper/videos(ubuntu)



http://www.youtube.com/user/essayboard/videos(ubuntu)



http://www.youtube.com/user/elithecomputerguy/videos(linux and general)



http://www.youtube.com/user/bsdtutorial/videos(bsdtutorial)



http://www.everymanit.com/classes/linux/



http://www.youtube.com/user/NovellLearning/videos(suse)



http://www.youtube.com/user/NovellLearning/videos(novell)



http://www.youtube.com/user/NovellServices/videos



http://www.youtube.com/user/novell/videos



http://www.youtube.com/user/theurbanpenguin(best suse so far)



http://www.youtube.com/user/lecturesnippets/videos



http://www.youtube.com/user/InfinitelyGalactic/videos



http://www.youtube.com/user/tostoday



http://www.youtube.com/user/PingCasts/videos



http://www.youtube.com/user/quidsup/videos



http://www.youtube.com/user/ProgrammersInstitute/videos



http://www.youtube.com/user/intelswnetwork/videos



http://www.youtube.com/user/networknutsdotnet/videos