28 Mar 17 Finding information in Linux

Linux Commands To Find Information

Linux is very flexible and people do all kinds of things with Linux so that it can be utilized in a best way possible depending on the environment. Linux allows some awesome command line tools and the list is huge but few recent ones I used, I’d like to share here for future reference and I might keep adding to this list as I encounter more.

grep – This basically allows you to find files and even lets you search text with in files. It is a pretty powerful command and gets used a lot especially by Linux Admins. I recently had a need where I needed to verify some information from a whole bunch of files in a directory and confirm if a specific IP Address is in any of the files. Opening each file and trying to find it was not an option. That is where grep saved the day.

grep -R “” /dir/next-dir/

This command basically allowed me to search for the IP Address in all files located in that directory. I was able to replace the IP Address with something else and searched for that as well. I’m sure it can be used in so many other ways depending on the situation and need.

netstat -an | grep PORTNUMBER | grep -i listen

This particular command basically allowed me to confirm if a specific port is open or not as I was trying to troubleshoot issues with connectivity to a particular system and firewall rules.

ip route get “ip-address”

This particular command allowed me to find out if there is a route available to a specific IP Address.

Tags: , ,

22 Jun 12 How to install .deb file in Debian

In order to install .deb files in Debian use the dpkg command. There certainly are many options with that command however I’m just posting a very simple single option i.e; Installing software using the dpkg command and .deb file. So the syntax that I follow is:

"dpkg -i filename.deb"

Tags: , ,

04 Jun 12 Open Source IP Address and Configuration Management

Open Source IP Address And Configuration Management Software – OpenNetAdmin

So I have used Rancid for Cisco Configuration Management, used IPPlan for IP Address Management. Both are good software and they do have their limitations, few things that I was looking for were not available and I am not a programmer plus I did not have time to play around with the scripts to much to get what I need going. Few things that I was looking for and were lacking in both software were following:

  • LDAP/Microsoft Active Directory Authentication
  • IP Address and Configuration Management both in one software
  • Cisco Startup as well as Running Configuration archives along with “show version”

After doing some research I came across a product called OpenNetAdmin. Absolutely loved this product. It has a built in plug in to perform authentication against LDAP/Micrsoft Active Directory. Group permissions, you can manage IP addresses as well as configurations in one place. And I was able to use it to pull down “startup config, running config and show version as well”. Take a look at all the OpenNetAdmin Features. You can also use it to manage DNS, however that wasn’t my need, oh and the installation is so much easier. My next post would be on How to Install and Configure OpenNetAdmin and some tips and tricks that I used to get it working.

Tags: , , , , ,

25 Apr 12 Installing Rancid on Debian

Rancid install on Debian notes

I had to recently test out couple of open source configuration management programs and the first one that I picked was Rancid. It is a pretty good program to backup your network equipment configurations. It can work with multiple vendors but I just needed it specifically for Cisco ASA firewalls, Cisco PIX and Cisco CSS. I have also used it previous for Juniper Netscreen configuration backups too.

Below are some of my installation notes that I typed up as I was going through the installation of Rancid:

  • Downloaded Rancid to /usr/src
  • wget
  • Create a Rancid user “adduser -home /home/rancid rancid”
  • apt-get install build-essentials
  • tar -xvfz rancid-2.3.8.tar.gz
  • Chage your directory to Rancid Foldercd rancid-2.3.8
  • Make Rancid user own the rancid directory
  • chown -R rancid:rancid /home/rancid
  • ./configure -prefix=/home/rancid -localstatedir=/home/rancid/var/rancid
  • make install
  • There will be whole bunch of text that will scroll, just make sure there are no errors and as long as there are no errors you are good to go
  • /home/rancid/etc/rancid.conf file is for the Rancid configuration. Use this file to create groups that represent location(s) or device(s).
  • Now create a “.cloginrc” file under “/home/rancid/” directory and specify credentials in this file for the devices
  • There is a “cloginrc.sample” file located int the main Rancid folder, that will show you how to set up the credentials
  • Now it is IMPORTANT that you setup proper permissions on this file as the passwords in this file get stored in clear text
  • chmod 600 .cloginrc and then chown rancid:rancid .cloginrc
  • Now you will create all the rancid groups but the command must be launched by the rancid user. So “su” as rancid (su – rancid)
  • If the directories are not created and you get errors check permissions, delete /home/rancid/var/group and re run the above command
  • Now for each group you have to modify the “router.db” file
  • File location that you need to edit is, “/home/rancid/var/rancid/group/router.db”
  • If you are going to be using the hostnames, make sure they resolve. Now run the “rancid-run” as rancid user, “/home/rancid/bin/rancid-run”
  • This will go and grab the configurations from the devices you specified and save them. Now you can view them via command line, however if you want a web interface you will need to install CVS or SVN. I installed CVS
  • apt-get install cvsweb
  • Update and modify /etc/cvsweb/cvsweb.conf to create the group
  • If the directory containing the cvsweb icons and css files is not in /var/www, you have to add a symbolic link : “ln -s /usr/share/cvsweb /var/www/cvsweb”
  • Now I was ready to view all the configs via web interface by pointing my web browser to http://ip-address/cgi-bin/cvsweb/

Tags: , , , ,

27 Mar 11 Installing IPPLAN

I spent lot of time installing IPPLAN – IP Address Management system, there was lot of Google searching involved, reading forums, lot of trial and errors so I decided to write notes about my installation so hopefully next time I need to do something I can just look at it at one location and perhaps this may help other users too.

First part was to choose which Operating System I am going to use to install IPPLAN. My personal two favorites are Ubuntu or Debian. So I ended up using Debian as Ubuntu is based on Debian, I just wanted to go with the original. I setup SSH access on the Debian so that I can just work from there.

After installing Debian and running all the updates on it next step was to download and install IPPLAN. IPPlan can easily be downloaded from Source Forge.

Prerequisites for installing IPPlan – IP Address Management Software (IPAM)

These are some of the things you want to install before you download and start installing IPPlan

  • Apache2
  • MySQL Server
  • PHP 5 and PHP 5 MySQL

Steps for installing, configuring IPPLAN

  • I created a folder on the desktop and called it sftw by using mkdir sftw
  • Next I changed my directory to that sftw directory and used the wget command to download it within that directory.
  • Now you have to unzip the file by using the unzip command.
  • Once that is completed what I did was renamed the ipplan directory, mv ipplan-4.92.a ipplan and then moved it under the /var/www by using mv ipplan /var/www/.
  • Next step is to create the mysql database for IPPlan. Use the following steps to create the database structure for IPPlan:
    1. “mysqladmin -u root -p create ipplan (This will use the root user to create the ipplan database – Of course you will have to type in the root password after you hit enter)
    2. “mysql -u root -p ipadmin” (This will create a user called “ipadmin”)
    3. “mysql grant all privileges on ipplan.* to ipadmin@localhost identified by ‘passwordforipplan’;” (This will give all the permissions to “ipadmin” user for the “ipplan” database. “passwordforipplan” will be the database password that you will define again later in the config.php file.)
    4. “mysqladmin flush-privileges” (This will reload the sql database)
    5. Now change directory to ipplan directory cd /var/www/ipplan if you are not already in it.
    6. Now you can use either vim or nano to edit the config.php file to update the entries for the database I like to use nano so nano config.php
    7. Scroll down to the following lines and enter the information accordingly, password you use here is the password to connect to the database that you defined above in Step 3
    8. Once you have this information filled out, there is one more step, which is defining the password for the “admin user” for IPPlan.
    9. Scroll down to the following lines and edit the password field, you can also edit the Administrator name in there if you like:
    10. Once these two steps are done save the file and close it.
    11. “chown -R www-data /var/www/ipplan” and “chmod 750 www-data /var/www/ipplan” (This will give the apache user permissions to the ipplan directory)
    12. Now you are set for the final install steps. Point your browser to http://localhost/ipplan/admin/install.php.
    13. On the page you will two option in the first option choose New Installation and the second option Run the sql now. Hit the “Go” button and you are done as long as you do not see any errors on the page
    14. Note: These instructions are mainly from how I did the install and from my personal notes. If you want to use them use them at your own risk, if you mess up something that is your responsibility. I suggest using a non production system first and test out everything that is what I did rest is your choice

      Tags: , , , , , , , ,

03 Mar 11 IP Address Management Software

So it has been a while since I wrote something here because of my move to Nashville, TN, new job which by the way I am absolutely loving. My boss gave me a
few projects to work on and one of them was to find a solution to better manage the IP Addresses across our network, (IPAM – IP Address Management)

After looking at multiple IP Address Management Software Solutions we decided to evaluate Solar Winds’ IPAM and an open source solution called IPPlan.

Solarwinds IP Address Management:

Solarwinds is a pretty cool company that offers some free and some paid software versions for IP Professionals. I downloaded their IP Address Management Software and installed it on one of our test servers. Had to install their base software which was a pretty big download and then the IP Address Management module. Installation was easy and very straight forward no issues there. Guest OS was Windows 2003 Server. After the install it had a pretty nice dashboard and had search capabilities. Software allowed me to manually add networks and devices as well as use SNMP to pull the settings from the network devices. Next thing I wanted to find out was the price, well for unlimited IP’s price tag was a little over $15000. It is a good software however certainly not worth that much in my personal opinion. So next I decided to install and try out IPPlan.

IP Plan – IP Address Management Software

Free, easy to install, fast interface. Even though this software didn’t have the fancy, pretty dash board but it was perfect for what we were trying to do. I was able to add customer sites to the database and was able to search them by name and accounts. It also offers you the option to import the subnets using XML files or from the routing tables.

Customizing the software is possible however requires in depth knowledge of php and mysql. Which is something I’m working on to customize the input fields, integration with Active Directory is something else I’d love to see in it. In the end I’d just like to say if you have the budget and want to shell out 15K plus more power to you, but if your IT Budget is not much you should check out IP Plan it is an excellent Open Source IP Address Management software.

Tags: , , ,

28 Jan 11 OpenSource VMWare tools on Debian

I was having all kinds of issues trying to install the regular VMware tools on Debian. It was asking for gcc and when I gave it a patch for gcc next it was telling me that I have the newer version of gcc which will not work well blah blah blah. So instead after some research I found out that I can install the Open Source version of VM Tools. It was pretty easy and works great on my Debian install

apt-get install open-vm-source
module-assistant prepare open-vm
module-assistant auto-install open-vm

Tags: , ,

WordPress SEO