[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

change IP and default route.

I installed a system on a company network with a fixed IP (, but recently bought a small router. The PC will now have to use the router as the default route, and I will make the IP private.

The following commands do what I want

# ifconfig eth0 netname # set my IP to
# route add default gw

But how do I set this to happen automatically? I changed the IP in /etc/hosts, and had an attempt at changing /etc/gateways, but clearly not successfully, as the routing does work after a reboot - I need to type these commands again.

Dr. David Kirkby PhD CEng MIEE
Senior Research Fellow
Department of Medical Physics
University College London
11-20 Capper St
London WC1E 6JA
Tel: 020 7679 6406 (direct line)
Tel: 020 7679 6262 (office)

Reply to: