Setting up a Static IP and route in Linux

The first step is to setup the interface with an IPĀ and a netmask:

# ifconfig eht0 192.168.1.25 netmask 255.255.255.0 up

Next we need to tell where we want to route the information to:

# route add default gw 192.168.1.1 eth0 

The above command is saying that we want a default gateway on interface eth0 to be 192.168.1.1 which is a router.