views:

57

answers:

3

hi,

I need to make a machine on my home network use a static ip address. It's a linux box.

My question is can I make just my linux box use a static ip address where the rest of my network (which is comprised of all windows machines linked up to a router) uses dynampic ip's?

It not so much the info on configuring the linux box to use a static ip it's just i'm confused - does my whole network have to use a static ip if I want to use a static ip on one box?

Many thanks

+1  A: 

Hi,

your router is probably running a dhcp server, so you should set your linux box to an ip which is not covered by the dhcp range of your router.

See man interfaces for information about how to set the static ip for your debian.

Regards

exic
A: 

Yes you can make your PC use a static ip while the rest of the network remains on DHCP

I'm Running Ubuntu Lucid (10.04)

2 options

  1. System->Preferences->NetworkConnection then editing the eth0 setting ipv4 to manual and set appropriate settings.
  2. manually edit the /etc/network/interfaces file, I added the following

auto eth0

iface eth0 inet static

address 192.168.0.7

netmask 255.255.255.0

network 192.168.0.0

broadcast 192.168.0.255

gateway 192.168.0.1

Tree77
ah ok...looks promising. I'm running debian but no prob to edit the interfaces file. Problem is i'm not sure which ip address I should pick. I think it's got to be out of the range that my router can assign and I don't know what that is
elduderino
well for my network i've configure my router to use 192.168.0.100 - .199 for dhcp. Now all static address are 192.168.0.2 - 192.168.0.99, 192.168.0.1 is the router address. There is no setting in my router to specify which ip's are static. However... it can assign a static ip to a certain MAC. But what if you change the network card in your pc, it won't get that static ip cause the MAC is different. This is why I get the OS to use the static ip
Tree77
Aha - gave me enough to go on there. My router also allows me to assign a static ip based on MAC address. but i've just managed to find out that my router has a range of 192.168.1.2 to 192.168.1.254 so i can go in to interfaces file and create an entry like the one you posted above. Only problem now is i'm not sure what ip address i should use - I can;t do 192.168.1.xxx as that whole range (from 1 to 255 is taken by the router)so can i use something like 192.168.2.xxx?
elduderino
well you could tell your router not to use that whole range, that way your whole network will be on 192.168.1.xxx .
Tree77
A: 

Most of the routers have option to assign static ip to a mac addres. Let you linux box on dhcp. Log on to router setting page. There should be a setting page to assign static ip to a given MAC address. This is available on Linksys router. If your doesn't support than see if you can flash your router with dd-wrt/open-wrt/tomato. these firmware definatly support this feature.

If you still want to configure you linix client and not the router than i suggest you pick the highest fourth quad number. Router will not use that ip unless you have so many box on the network.

Sudhir