I use iproute for it, It allows a 'professional' way to specify routes.
Here is how I get off the LAN (171.68.128/24)
=========================================================================
#!/bin/sh
# loopback device
ifconfig lo 127.0.0.1
iproute add 127/8 dev lo
# ethernet device
IPADDR=171.68.128.13
NETMASK=255.255.255.0
BROADCAST=171.68.128.255
ifconfig eth0 ${IPADDR} netmask ${NETMASK} broadcast ${BROADCAST}
NETWORK=171.68.128/24
iproute add ${NETWORK} dev eth0
DEFAULT=0.0.0.0/0
GATEWAY=171.68.128.1
iproute add ${DEFAULT} gw ${GATEWAY} metric 1 dev eth0
=========================================================================
Note the $DEFAULT which was 0.0.0.0/24 when I used
=========================================================================
#!/bin/sh
ifconfig lo 127.0.0.1 netmask 255.0.0.0 broadcast 127.255.255.255
route add -net 127.0.0.0 netmask 255.0.0.0 dev lo
IPADDR=171.68.128.13
NETMASK=255.255.255.0
NETWORK=171.68.128.0
BROADCAST=171.68.128.255
GATEWAY=171.68.128.1
ifconfig eth0 ${IPADDR} netmask ${NETMASK} broadcast ${BROADCAST}
route add -net ${NETWORK} netmask ${NETMASK} dev eth0
route add default gw ${GATEWAY} netmask ${NETMASK} metric 1
=========================================================================
For one reason or another this did not work.
Greetings,
-- marc. \|||/
(o o)
--------------------ooO-(.)-Ooo------------------------------------
| | Cisco Systems Belgium |
| | | | Complex Antares |
| ||| ||| | 71, Avenue des Pleiades |
| ||||| ||||| | B-1200 Brussels |
| ..:|||||||:..:|||||||:.. | --------------- |
| | BELGIUM EUROPE |
|-------[ Cisco Systems ]---------- --------------------------------|
| Advanced Customer Support | alias: tacsuns@cisco.com |
| | e-mail: mduponch@cisco.com |
| | tel: +32 2 778 42 40 |
| Marc Duponcheel | GSM/cell: +32 75 46 46 13 |
| MIS analyst | beep/pager: +32 72 53 30 01 |
| | mduponch.pager@cisco.com |
----------------------------->8------------------------------------