Monday, April 11, 2011

Wireless Captive Portal

Thinking of setting up a wireless network using Aruba Controller with captive portal. Yes, Aruba Controller has captive portal system but not to my liking. So I decided to use pfsense firewall again. I'll sketch the diagram and post it here later.

Monday, April 4, 2011

IPv6

I succeeded in making a tunnel to enable IPv6 connectivity from my test site. I'm using HE.net tunnel (http://tunnelbroker.net/) and pfsense firewall as the router/firewall. Here is the guide I used to configure the tunnel from pfsense.

Tuesday, March 29, 2011

Centos Yum

Yum can be use to install packages in Centos. Default repository will be pointing to the nearest repository servers. You can add additional repository like this. First search for repository. Here is one of repository for RH and Centos : http://www.jasonlitka.com/yum-repository/

After adding new repository, just issue

yum list

This will update yum cache and will list all packages available to all repositories.

Then, you can just install the packages. For example :

yum install ntp

Will install ntp package.

To update all packages,

yum update

Bare in mind that to use yum command on RH, you must have a valid subscription to Redhat Network.

Tail Command

What if you want to view just last 100 lines of a log file? You can use tail command. Tail command is a pretty handy command to view text file.

Example :
tail -n 100 /var/log/messages

You can also use this command to view text file and it will display last line plus incoming log as it is written.

Example :
tail -f /var/log/messages

Try these examples yourself and see what is the output.

Sunday, March 27, 2011

Mysql - flush-hosts

My organization's mysql server always needed to execute mysqladmin -flush-hosts command (1 week interval). I don't want to do that everytime our web server could't contact its database server. So what am I to do? Well, I tried using cron but the mysql server need to be authenticate to run mysqladmin command. At last, I found one solution. EXPECT! How?

Make sure you install expect in your mysql server (Centos Linux). Just issue command

yum install expect

Then, make a script file like this:

#!/usr/bin/expect
set timeout 20
spawn /usr/bin/mysqladmin -p flush-hosts

expect "Enter password: "
send "yourmysqlrootpasswd\r\n"

save this script and add this script to run in cronjob.

That's it. Done. You might want to chmod this script to 700 first.

Monday, December 7, 2009

Ubuntu Server : Change ip from DHCP to Static

Since Ubuntu server does not install GUI, so we need to use CLI to change the IP address from DHCP to Static.

Go ahead and open terminal/console for your server.

Edit this file using your favorite editor.

sudo nano /etc/network/interfaces

This is how it looks (using DHCP)

auto eth0
iface eth0 inet dhcp


Now, some editing required. Change it to this :

auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

Save it. Next we need to change some parameters in /etc/resolv.conf

sudo nano /etc/resolv.conf

Change the line 'nameserver xx.xx.xx.xx' to 'nameserver 192.168.1.4' where 192.168.1.4 is your name server.

Now, remove dhcp-client from your server.

sudo apt-get remove dhcp-client

Lastly, we need to restart networking service

sudo /etc/init.d/networking restart

Done. Try and ping any server (yahoo, google etc).