How to add static IP via cmd line?

Wander Boessenkool wander at tomaatnet.nl
Wed Dec 22 17:08:00 UTC 2004


On Wed, 2004-12-22 at 09:50 -0500, EdCrypt wrote:
> Senectus . Wrote: 
> > How do you force a static IP, DNS, netmask and Gateway via the cmd
> > line?
> > 
> > -- 
> > Ubuntu Warty 4.10
> > 
> > -- 
> > ubuntu-users mailing list
> > ubuntu-users at lists.ubuntu.com
> > http://lists.ubuntu.com/mailman/listinfo/ubuntu-users
> ifconfig.

ifconfig for the ip and netmask see 'man ifconfig'
(sudo ifconfig eth0 192.168.10.10 netmask 255.255.255.0)

/etc/resolv.conf for the dns -> man resolv.conf
(sudo vi /etc/resolv.conf)

route for the default gw -> man route
(sudo route add default gw my.default.gateway)

If you want your changes to be permanent edit /etc/network/interfaces,
besides the man-page you can find a lot of info about this topic online,
try http://www.tldp.org and look at their sections of how-to's and
manuals.

-Wander

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20041222/63759aad/attachment.sig>


More information about the ubuntu-users mailing list