Static IP

Is it possible, and if so, how can I assign a static IP address to my RedHat 8.0 machine. I am using a Linksys router/switch with DHCP enabled. I have a small linux/windows2000 LAN at home. I want to assign a static IP so that I can setup port forwarding to my linux machine so that I can ssh into from the internet. Thanks in advance for any help/suggestions anyone might provide.

You can assign static IP addresses with the route command.

Also, might also need to disable your DHCP client.

no wait, i have a linksys 4 port cable/dsl router and you dont haveto disable DHCP. just make sure that whatever ip address you assign does not fall into the 192.168.1.100/255 range. assign it 192.168.1.2 and increment from there so its easier to keep track of what has what. you can still use DHCP.

I have it assigned as 192.168.1.21 right now. Are you saying that I should assign it as follows: 192.168.1.101 (make this static on the linux machine) and then have the router begin assigning IPs from 102?

I am trying to get my www.no-ip.com client working so that I can "see" my PC from anywhere ont the net without messing up my DHCP. I connect my work laptop to my network at home. No-IP is a free DNS client - pretty cool.

no, if you have DHCP enabled then you can NOT use addresses in the range of 192.168.1.100/255 , in addition, with DHCP disabled you still can not use 192.168.1.255 because that address is reserved. the address you have assigned (192.168.1.21) is fine. so for example, you said that you want to allow ssh connections to 192.168.1.21 from out side of your LAN. you would do this with port forwording, you set up on the router to forword port 22 to 192.168.1.21. then to access your ssh server from out side of your lan all you have to do is connect using your external ip address (what your isp assigns). you can also set up DNS with www.no-ip.com like you said.

Sorry, that is simply not true. We have a similar set up at home and use both DHCP and static addresses from the same address block. It works fine. Some PC get their addresses from the DHCP server (software in the Linksys router), others use assigned static IPs.

We don't do it, but the device can be configured to only allocate DHCP IPs from a small range of numbers. Unless you have a giant LAN that is using almost all the addresses, this is not a problem.

Since the poster indicated that they have a small LAN, simply assign a static IP outside of the 'normal' range of DHCP allocations.

And, if I'm not mistaken, ARP should make this moot in many DHCP servers; i.e. a good DHCP server should check its ARP cache before assiging an IP to check to see if it is in use on the segment.

For example, here is a quote from:

OBTW: if you are operating your own small private LAN, you don't need to be worried about the hypothetical DHCP vulnerability above.

thats what i ment, though i think i didnt express my thoughts well. i do the same thing at home, the dhcp server will give out address in the 192.168.1.100/150 range, the desktop machines use dhcp and my web and mail server are assigned static addresses, the way i did it was just to go from 192.168.1.2 and on.

i was wrong about not being able to assign addresses within that range, ( the amount of IPs the dhcp server is set to give out.)
and as neo said , assign them outside of the normal range.

to make it simple, you can assign a static ip to a client, as long as that ip is not in use by another dhcp client.

sorry, the mistake was confusion on my part.

Yes, and normally if an IP address is statically assigned, the DHCP server will not try to assign it because the ARP cache will show that address in use. So, if you accidentally use an IP address that the DHCP server might allocate, if it is properly looking at the ARP table, it will not try to assign it.

Having said that, all DHCP servers are not created equal; but for small LANS, no problem usually. For very big LAN segments, more robust DHCP servers are a good thing.

BTW, on my little D-Link cable-modem router with DHCP, it is a configuration option to tell the D-Link DHCP process what range of IPs to allocate.