PDA

View Full Version : [ubuntu] How to set a static IP address



Prince Valiant
May 11th, 2009, 05:38 PM
I'm working on setting up a networked printer, and I can't figure out how to set a static IP address on the server that the printer is connected to. Anyone able to tell me how? Please bear in mind that I may not be able to understand everything you write. Thanks!

-Val

P.S. I tried to follow this (http://www.jonathanmoeller.com/screed/?p=847) website's instructions, but I apparently don't have a file named "network." Thanks!

P.P.S. I'm running Ubuntu 8.10

Peter09
May 11th, 2009, 05:41 PM
If you are using a router the best place to set a static ip address is in the LAN area of your router. DHCP will still happen but the router will always deal the same ip to your machine.

superprash2003
May 11th, 2009, 05:46 PM
here's a way http://www.prash-babu.com/2009/01/how-to-setup-static-ip-in-ubuntu.html

chili555
May 11th, 2009, 05:57 PM
With all due respect to my esteemed colleague superprash 2003, if it's a server, it probably doesn't have or run a window manager and therefor Network Manager is not installed. I suggest editing /etc/network/interfaces to look like this:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.108
netmask 255.255.255.0
gateway 192.168.1.254Restart the interface:
sudo ifdown eth0 && sudo ifup eth0Substitute your details as needed.

Static IP implies that you, not the DHCP server, will handle the DNS name servers. I suggest that /etc/resolv.conf read like this:
nameserver 192.168.1.254Let the router handle it for you.

Post back if you get stuck.

superprash2003
May 12th, 2009, 11:02 AM
correct.. my mistake..didnt notice the "server" part..

sahabcse
May 12th, 2009, 11:04 AM
Follow below url for setting up the network

http://sahabm.blogspot.com/2009/01/linux-network-configuration-ubuntu.html

Iowan
May 13th, 2009, 03:35 AM
Unfortunately, the instructions in the link you posted need some editing - the file is NOT /etc/interfaces/network - but (as in chili555's example) /etc/network/interfaces.

Personally, I like the method known as a static lease. The DHCP server is configured (if it will handle it) to issue the same address to a machine based on it's MAC address. My laptop is currently failing to get a DHCP lease, so static lease won't work - but static address does.

Prince Valiant
May 14th, 2009, 02:25 AM
Thanks for all the help! I apologize to chili555, but I was wrong when I said I'm using a sever...it's the desktop version of Ubuntu 8.10 being used as a sever. I used superprash's instructions successfully.

-Val

Iowan
May 15th, 2009, 01:21 AM
correct.. my mistake..didnt notice the "server" part..As fate would have, that's probably a GOOD thing...