Search Windows and Linux Networking

Saturday, July 30, 2011

Some Useful Tools

Some Useful Tools

Following are the some use full tool we should know for troubleshoting network and active directory related problems

1.      IPconfig.exe :- It use for view and manage network configuration. It displays all current TCP/IP network configuration values and refreshes Dynamic Host Configuration Protocol DHCP and Domain Name System DNS settings
2.      ping.exe:- utility used to test the reachability of a host on network to Verify network connectivity.
3.      Netdiag.exe :- Netdiag.exe performs a series of tests to determine the state and functionality of your network client computer. It Check end-to-end network connectivity and distributed services functions.
4.      Pathping.exe :-  Trace a route from source to destination on a network, show the number of hops, and show packet loss.
5.      DCdiag.exe :- Analyze the stare of domain controller in a forest or enterprise.
6.      Dsastate.exe :- Compare directory information on domain controllers and detect differences.
7.      Netdom.exe :- Allow batch management of trusts, joining computers to domains and verifying trusts and secure channels.
8.      Net :- Perform common tasts on network services, includeing stopping , starting and connecting to network resources.
9.      ADSI Edit:- View , Modify and set ACL (access control lists) on objects in the directory.
10.  Active Directory Domains and Trusts :- Administer domain trusts, add user principle name suffixes, and change the domain mode.
11.  Repadmin.exe :- verify replication consistency between replication partners, monitor replication status, display replication metadata, and force replication events and  topology recalculation.
12.  Active Directory Sites and services:- Administer the replication of directory data
13.  Active Directory Users and Computers:- Administer and publish information in the directory.
14.  DNS snap-in:- Manage DNS
15.  Event Viewer:- Monitor events recorded in event log..
16.  Ldp.exe :- Perform Lightweight Directory Access Protocol (LDAP) operations against Active Directroy.
17.  Linkd.exe :- Create , delete, update, and view the links that are stored in junction Points.
18.  Nltest.exe :- verify that the locator and secure channel are functioning.
19.  Ntdsutil.exe :- manage active directory fsmo role and meta data
20.  regedit.exe :- view and modify registry settings.
21.  secedit.ese :- mange group policy setting
22.  Services Snap-in :- Start, stop , pause, or resume services on local or remote computer and configure startup and recovery option for each services.
23.  Setspn.exe :- Manage service principal Names.
24.  w32tm :- Manage windows time service.

Wednesday, July 27, 2011

Admin should know this information


If you are who taken care of computer or Network system then you have to know following things for your network system.
  1. How many hard drives do you have?
  2. what size is each hard drive?
  3. if you have more than one hard drive , which is the primary one?
  4. what kind of hard drive do you have?
  5. how much RAM do you have? Make , Type (SD, DDR, DDR2...)and speed?
  6. do you have SCSI adapter? If So, who made it and what model is it?
  7. do you have RAID system? If So, Who made it and what model is it?
  8. what type of mouse do you have
  9. how many buttons does your mouse have
  10. if you have a serial mouse, what com port is it connected to?
  11. what is the make and model of your video card ? how much video RAM do you have?
  12. what kind of monitor do you have (make and model)?
  13. will you be connected to a network ? If So what will be the following:
  • your IP Address?
  • Your nemask?
  • Your gateway address?
  • Your domain name server’s IP address?
  • Your domain name?
  • Your hostname?
  • Your types of network card (make and model)
  • Your number of card
 14. System is connected to other system, Switch, Hub, or Router?
  • If it connected to system then what IP address it has? why system is connected to other system (Role of other system Firewall, Router, NAT)
  • If it connected to Switch. Then how many port it has, make and model. It is L2 or L3 Switch. what the IP address of switch, is it switch has configure VLAN? if yes then how many VLAN , subnet for each VLAN. 
  • If it connected to Router, then what is the IP address of Router, make and model. how many interfaces it has. IP address infromation of each interface, how the Router is configure, static or Dinymic, is it filtering (Firewall) are enabled ? if yes then what port and network are open. and how the ACL are set? 

Thursday, July 14, 2011

How to Install Wine in Ubuntu to run windows software in Linux

Installing Wine in Ubuntu to run windows software  from Linux

Wine lets you run Windows software on other operating systems. With Wine, you can install and run these applications just like you would in Windows.

Add repository for Ubuntu:-

sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get update
sudo apt-get install wine1.3


OR

You can download letest version from:-
http://www.winehq.org/
http://ibiblio.org/pub/linux/system/emulators/wine/

Wednesday, July 13, 2011

Step by step installing Clonezilla Server (Alternative to Symantec Ghost Server) on Ubuntu


Step by step installing Clonezilla (Alternative to Symantec Ghost Server) on Ubuntu

Clonezilla Server is used to clone many computers simultaneously across a network this is done using DRBL (Diskless Remote Boot Loader)  Server and computer that can boot from network.  DRBL required at list two LAN card so if your system not having two physical LAN card you can use network alias to fulfill requirement of DRBL. due to my system also not having two physical LAN card I am using alias eth0:0 and physical LAN Card eth0
(Note:- you have to make changes as per your network setup ) 

Configure network:-
$ sudo vi /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
     address 192.168.0.33
     netmask 255.255.255.0
     gateway 192.168.0.1
auto eth0:0
iface eth0:0 inet static
     address 192.168.1.133
     netmask 255.255.255.0

Remove network manager service (demean):-
$ sudo apt-get remove network-manager
Add repository in sources.list file
$ sudo vi /etc/apt/sources.list
deb http://free.nchc.org.tw/ubuntu hardy main restricted universe multiverse
deb http://free.nchc.org.tw/drbl-core drbl stable

Get and Install Key:-

$ sudo wget http://drbl.nchc.org.tw/GPG-KEY-DRBL

--2011-07-12 11:11:47--  http://drbl.nchc.org.tw/GPG-KEY-DRBL
Resolving drbl.nchc.org.tw... 211.73.64.9
Connecting to drbl.nchc.org.tw|211.73.64.9|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1361 (1.3K) [text/plain]
Saving to: `GPG-KEY-DRBL'

100%[======================================>] 1,361       --.-K/s   in 0s

2011-07-12 11:11:48 (32.2 MB/s) - `GPG-KEY-DRBL' saved [1361/1361]

$ sudo apt-key add GPG-KEY-DRBL
OK
                              
Update repository and install DRBL

$ sudo apt-get update
$ sudo apt-get install drbl

Install dependencies for Clonezilla:-

$ sudo apt-get install util-linux tar gzip bzip2 procps dialog rsync parted pciutils

$ sudo apt-get install tcpdump bc grub gawk hdparm sdparm netcat file ethtool

$ sudo apt-get install syslinux mtools mkisofs reiserfsprogs e2fsprogs psmisc locales

$ sudo apt-get install wget disktype zip unzip initscripts tftpd-hpa nfs-kernel-server

$ sudo apt-get install nis ntp curl lftp libdigest-sha1-perl partclone mkpxeinitrd-net

$ sudo apt-get install clonezilla mkswap-uuid drbl-partimage drbl-ntfsprogs

$ sudo apt-get install drbl-chntpw drbl-lzop udpcast drbl-etherboot freedos lvm2

$ sudo apt-get install ntfs-3g lshw etherwake ssh
$ sudo apt-get install dhcp3-server (If you have not existing DHCP server )

Configure the boot image:-

$ sudo /opt/drbl/sbin/drblsrv-offline -s `uname -r`

Press Enter key to continue
(It will check for required packages that are not installed on system. Note down the packages name. In my system it is showing following packages are not installed)

These required packages are not installed:  lzop pigz pbzip2 patch traceroute expect partimage gpxe

If all required packages are not install it ask you to continue

Are you sure you want to continue?
Press n

This will terminate process.
Now install required packages by using apt-get install command for example in my case

$ sudo apt-get install lzop pigz pbzip2 patch traceroute expect partimage gpxe

Rerun command to configure boot image

$ sudo /opt/drbl/sbin/drblsrv-offline -s `uname -r`

It rechecks all required packages and then configure boot image

Configure environment:-

$ sudo /opt/drbl/sbin/drblpush –i
(It asks some question and setup environments as per answer you provided make necessary changes as per your environment)

Please enter DNS domain (such as drbl.sf.net):
[drbl.name]

example.com

Please enter NIS/YP domain name:
clonezilla

Please enter the client hostname prefix:

Clone

The public IP address of this server is NOT found.
Which ethernet port in this server is for public Internet accsess, not for DRBL connection?
Available ethernet ports in this server:
eth0 (192.168.0.33), eth0:0 (192.168.1.133),
[eth0]

eth0

In the system, there are 3 modes for diskless linux services:
[0] Full DRBL mode, every client has its own NFS based /etc and /var.
[1] DRBL SSI (Single system image) mode, every client uses tmpfs based /etc and /var. In this mode, the loading and necessary disk space of server will be lighter. NOTE! (a) The client machine memory is recommended at least 256 MB. (b) The setting and config files of client will not be saved to the DRBL server! They are just used once and will vanish after the machine shutdowns! Besides, if you modify any file in the template client (located in /tftpboot/nodes), you have to run /opt/drbl/sbin/gen_ssi_files to create the template tarball in /tftpboot/node_root/drbl_ssi/. (c) If you want to provide some file to overwrite the setting in the template tarball when client boots, check /tftpboot/node_root/drbl_ssi/clients/00_README for more details.
[2] I do NOT want to provide diskless Linux service to client.
Which mode do you prefer ?

2

In the system, there are 3 modes available for clonezilla:
[0] Full Clonezilla mode, every client has its own NFS based /etc and /var.
[1] Clonezilla box mode, every client uses tmpfs based /etc and /var. In this mode, the loading and necessary disk space of server will be lighter than that in Full Clonezilla mode. Note! In Clonezilla box mode, the setting and config files of client will not be saved to the DRBL server! They just use once and will vanish after the machine shutdowns!
[2] I do NOT want clonezilla.
Which mode do you prefer ?

1

When using clonezilla, which directory in this server you want to store the saved image (Please use absolute path, and do NOT assign it under /mnt/, /media/ or /tmp/) ?
[/home/partimag]

/home/partimag
Do you want to set the pxelinux password for clients so that when client boots, a password must be entered to startup (For better security)
n
Do you want to set the boot prompt for clients ?
n
Do you want to use graphic background for PXE menu when client boots ?
Note! If you use graphical PXELinux menu, however client fails to boot, you can switch to text mode by running “/opt/drbl/sbin/switch-pxe-bg-mode -m text”.
y
Do you want to let DRBL server as a NAT server ? If not, your DRBL client will NOT be able to access Internet.
N
We are now ready to deploy the files to system!
Do you want to continue ?
Warning! If you go on, your firewall rules will be overwritten during the setup!
The original rules will be backuped as iptables.drblsave in system config directory (/etc/sysconfig or /etc/default).
y

Start the Clonezilla server

$ sudo /opt/drbl/sbin/dcs
do you want to set the mode for all the clients or just some of them? Select mode: windows
select all select all the clients.

In next switch mode windows select Clonezilla-start


In next windows select Beginner 


On next window select “select-in-client” so you can choose to backup or restore an image on a client by client basis.




On the last two windows you should select the default values provided.
 

 


That’s it. Clonezilla is ready to go only because we have not install DHCP server and want to use our existing windows DHCP server we have to configure dhcp server to work with clonezilla

Configure Windows DHCP Server for Clonezilla:-
Configure the option 066 for boot server name for ip address of Clonezilla server.
 and Configure option 067 for boot file name as pxelinux.0
Now go to client and set client system to boot from network . after first boot set to network client will boot from network and you will see boot menu like this:

More:-

Next time we will see how to capture image and how to restore by using clonezilla. 

Thursday, July 7, 2011

Creating VPN Connection on Linux (Ubuntu) using command line (PPTP Client for windows VPN Server)

Creating VPN Connection on Linux (Ubuntu) using command line (PPTP Client for windows VPN Server)

Last time we see how to create vpn connection on Ubuntu using GUI. Now we create connection by manually editing required file and by executing commands

To successfully configure PPTP VPN Client we need:-
  • /etc/ppp/peers/myvpn (Suppose we have given name to tunnel or connection as myvpn for our identity purpose)
  • /etc/ppp/chap-secrets
  • Server name or ip address of vpn server.
  • User name and password to connect vpn server.
  • Most important pptp-linux package

Step to create VPN connection:-
  • Install Package 
  • Create tunnel file . for Eg. I have creating myvpn as a connection or tunnel name.
  • Povide authentication information in chap-secrets file
  • Dial connection
  • Add route
Install Package:-
# apt-get install pptp-linux

Create tunnel file:-
Open the terminal and Create new file and type following details in tunnel file please replace your tunnel file name, user name and server detail high lighted with Red color.

# vi /etc/ppp/peers/myvpn

remotename myvpn
linkname myvpn
ipparam myvpn
pty "pptp vpn.mycompany.com --nolaunchpppd"
name myvpnuser
usepeerdns
require-mppe
refuse-eap
noauth
file /etc/ppp/options.pptp

Provide Authentication details:-
Please change accordingly syntax is “username” “connation name” “User Password” “*”  in following file.

# vi /etc/ppp/chap-secrets

myvpnuser myvpn User@password *

Dial Connection:-
Now dial connection with following command in terminal

# pon myvpn nodetach

Add default Route:-
(every time you need to add this route after vpn connected or you need to crate script for that)
Now open other tab in terminal or other terminal type following command

# route add default ppp0

Check default route added successfully by typing following command

# route
And make sure that following route are show in result

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default             *                      0.0.0.0              U        0      0        0    ppp0

Now you are successfully connected to Windows VPN Server.
to disconnect connection simply press Ctrl+C in first terminal

Tuesday, July 5, 2011

Creating VPN Connection on Ubuntu (PPTP Client for Windows VPN Server)

Creating VPN Connection on Ubuntu (PPTP Client for Windows VPN Server)

To configure VPN Connection You should at least know name or IP address of VPN Server. user name and password to connect .

  • To configure VPN Connection on Ubuntu go to menu bar and select internet icon > VPN ConnectionConfigure VPN
  • This will open Network Connections windows. In VPN tab Select Add to add new VPN connection
  •  in new connection wizard Select VPN Connection Type as Point-to-Point Tunneling Protocol (PPTP) and Select Create button.
  •  In Next Windows type the name for connection for example your vpn.mycompany.com or anything for your identity. make sure you have uncheck at connect automatically option and available to all users option . In VPN Tab type IP address or DNS name of your VPN server in Gateway field. and type valid user name and password in user name and password filed to authenticate to VPN Server. live NT Domain name blank or time your domain name and then select Advanced button. 
  •  In  PPTP Advanced options windows make sure you have selected use point-to-point encryption (MPPE) and MSCHAP and then click OK.
 Now your vpn connection is created for connect to windows vpn server. Now close all the windows and go to menu bar and Select Internet Icon > VPN Connection > then select you just crated vpn connection by clicking on your connection name. it will attempt to connect your vpn server and ip you have enter valid Server information and user authountication it will be connected. you will see small lock on Internet Icon.