Monday, January 11, 2010

Finding Specific MAC - (Cisco IOS)

Finding a specific MAC in Cisco IOS can be accomplished via:

show mac-address-table

This gives a complete table of Port vs. Mac Addr.

If you want to find a specific mac address, lets say 00:11:22:33:44:5e use:

show mac-address-table | include 445e

The output is similar to Unix "grep" command.

For further debugging you can use show interface status and/or show cdp neighbors to see where it connects to.

Howto change NIC order in Linux (SUSE 10)

I recently had an issue with a mother board that was replaced on some server, after renaming the configuration file to the correct MAC address (ifcfg-eth-id-00:1a:64:7a:d0:be), the new NIC was recognized as eth4, (and not eth0 as previously),after digging abit in the depths of the OS I have found a solution:


Through this file you can configure the NIC order by MAC address.
For example:

SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:1a:64:7a:d0:be", IMPORT="/lib/udev/rename_netiface %k eth0"

To change take place you will probably need to reboot the machine so udev will re-read it's configurations(restarting networking service is not enough).

Friday, January 8, 2010

Perl One Liner:Fibonacci Series

Now for something little different, I stumbled upon in the net, this one liner prints the Fibonacci series (first 20 numbers).

perl -e'@p=(0,1);until($#p>20){print"$p[-2]\n";push @p,$p[-2]+$p[-1]}'

The power of Perl...

Assign static adress via DHCP (Cisco IOS)

Usually a good idea will be to assign a static IP allocation for a server, in order to do that we need to get servers MAC address as it's identifier:

Next , prepend 01 to it and insert a dot after every fourth character to get the client-ID you need to enter on the DHCP server. For example, the MAC address 0200.1000.1234 becomes client-id 0102.0010.0012.34, and the static DHCP pool (Server_static) on a router is configured as follows:

cisco851(config)#ip dhcp pool Server_static
cisco851(dhcp-config)#client-identifier 0102.0010.0012.34

Saturday, January 2, 2010

Howto:Install & Configure SWAT

In this article I will demonstrate how to install SWAT on Ubuntu Linux (the tutorial is good for almost any other Linux distro). I come out of conclusion that samba service is already installed so I will focus more on SWAT.
SWAT is a great GUI managment tool that allows us to manage Samba services via user friendly web-interface, the latest version of SWAT is very dynamic and includes many great options (such as LDAP,Kerberos,Domain Controller authentication and many more) for smooth intergration with Windows based environment.

First install SWAT with:

apt-get install swat

Next, verify SWAT installation:

I suggest to configure SWAT via Xinet.d deamon, all you have to do is create an apropriate file with xinetd rules:

touch /etc/xinetd.d/swat

vi /etc/xinetd.d/swat

This is how the configuration file will look like (in general):

As you can see, we allowed access from localhost, and the port that will be bound to SWAT service is port 901 tcp.
It will be a good idea to restart xinetd service so the changes take place:
/etc/init.d/xinetd restart
Now, verify that xinetd is running and the port is bound to SWAT:

We are almost there, if you have firewall set a propriate rule and allow traffic to port 901 (localhost).
Try accessing the GUI via the your browser:
*note if you're asked for password you should add a samba administrator via:
smbpasswd -a samba_admin

Works like magic, from here you can perform any needed Samba related administration tasks.