25 Aug, 2008  |  Posted by Danesh  |  in HowTo, Linux

IPCop till today does not have a GUI to add static routes.

The manual method. You will have to do this every time IPCop is rebooted.

root@proxy73:~ # route add -net 10.0.0.0 gw 10.38.24.1 netmask 255.0.0.0

Now let’s make the route persistent across reboots. There are 2 files for this. Use either one depending on your needs.

You can add the route command at the end of the /etc/rc.d/rc.local file. The route will be added every time IPCop is rebooted but not everytime the interface is restarted. Good for a box with minimal changes.

root@proxy73:~ # echo "route add -net 10.0.0.0 gw 10.38.24.1 netmask 255.0.0.0" >> /etc/rc.d/rc.local

The other way would be to add the route command at the end of the /etc/rc.d/rc.netaddress.up file. This will ensure that your routing table gets updated every time the interface is restarted.

root@proxy73:~ # echo "route add -net 10.0.0.0 gw 10.38.24.1 netmask 255.0.0.0" >> /etc/rc.d/rc.netaddress.up

I personally use the latter.

To view your routing table run the “route” command.

root@proxy73:~ # route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
213.27.199.80   *               255.255.255.248 U     0      0        0 eth2
192.168.1.0     *               255.255.255.0   U     0      0        0 eth1
10.38.24.0      *               255.255.248.0   U     0      0        0 eth0
10.0.0.0        10.38.24.1      255.0.0.0       UG    0      0        0 eth0
default         213.27.199.81   0.0.0.0         UG    0      0        0 eth2

30 Jun, 2008  |  Posted by Danesh  |  in HowTo, Linux

To view the current routing table run “route -n

[root@klmppswdr01p ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.41.42.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.41.41.0 10.41.42.8 255.255.255.0 UG 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 10.41.42.1 0.0.0.0 UG 0 0 0 eth0

To add a route refer to the command below.

"route add -net 10.41.41.0 netmask 255.255.255.0 gw 10.41.42.8"

To delete a route refer to the command below.

"route del -net 10.41.41.0 netmask 255.255.255.0 gw 10.41.42.8"

The routing information above is not persistent across reboots. After a reboot, the routing information will be lost and you need to add them in again.

To make the routing information persistent, add the “route add” line as seen above into the /etc/rc.local file.

Sample /etc/rc.local file.

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
route add -net 10.41.41.0 netmask 255.255.255.0 gw 10.41.42.8

16 Jun, 2008  |  Posted by Danesh  |  in HowTo, Linux

This is a newbie question I get quite often.

Configuring your Linux machine to run on a static IP is easy. Tools like system-config-network and netconfig provide you simple GUIs to do this.

For today, I’ll show you how to do this from the command line instead.

Navigate to /etc/sysconfig/network-scripts/

[root@baboo]# cd /etc/sysconfig/network-scripts/

Every network interface will have it’s own interface script file. eth0,eth1,eth2 and so on. Vi the ifcfg-eth0 interface script file for interface eth0. Replace the contents of the ifcfg-eth0 file with the parameters below.

[root@baboo]# vi ifcfg-eth0.

DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.0.100
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
HWADDR=00:0F:22:71:0A:53
USERCTL=no
USERCTL=no

If you want to switch back to DHCP, repeat the steps above and replace the contents of the ifcfg-eth0 file with the parameters below.

DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:0F:20:71:0A:50
ONBOOT=yes
TYPE=Ethernet
DHCP_HOSTNAME=klmdrpdr01p.klm1.netcel360.com

Restart your interface to apply the changes.

[root@baboo]#ifdown eth0
[root@baboo]#ifup eth0

To update your dns server settings, modify the /etc/resolv.conf.

[root@baboo]# vi /etc/resolv.conf

Replace the contents of the resolv.conf file with the parameters below. The first parameter “search” is your search path followed the nameserver parameters which hold the IPs for your primary and secondary DNS servers.

search example.com
nameserver 192.168.0.5
nameserver 192.168.0.6

That’s it. Drop me a note if you need any help.

3 Apr, 2008  |  Posted by Danesh  |  in HowTo, Linux

Developers in my office constantly complain that the SMTP server is down and no mails are being sent out. We come back saying that their application is buggy. Most often after hours of troubleshooting the problem will turn out to be the application itself.

Here’s a simple way to test your SMTP server over port 25 using Telnet to proof them wrong.

Telnet to the server via port 25.

1. Key in “EHLO example.com” and hit enter.

2. Key in “MAIL FROM: sender@domain.com” and hit enter.

3. Key in “RCPT TO: recipient@domain.com” and hit enter.

4. Key in “DATA” and hit enter.

5. Key in your message body and hit enter.

6. Key in ” . ” and press enter.

If you received the mail then your SMTP is working fine.

Sample output,
Continue Reading ->

7 Feb, 2008  |  Posted by Danesh  |  in BitTorrent, Cool Stuff, Me

I’m working late tonight. Been in the office since morning and I desperately need to shower and have some food.

Thought I’ll share this picture with you since it’s the only thing keeping me motivated to work late nowadays. Speed = smile on Danny’s face. :D

Update: 12:52am

Just crashed my Netgear WGR614 router with the new speed :)

Streamyx!! This is what happens when you deprive us of bandwidth.