• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Static ip behind dhcp?

Kai4Linux

Member
Hey all im on linux, behind a linksys router. I did ipconfig eth0 192.168.1.101 255.255.255.0, cause i thot it gives dit that ip, b ut my router keeps changing the ip to 192.168.1.102. ANy idea how to keep it static? Thanks
 
I'm prety sure I remember reading in the manual that if you wanted a static ip, you would have to use 192.168.1.2 - 192.168.1.99. I dont have it handy but I know that the router doesnt assign those IP's to computers using DHCP. It sounds like your system is setup to use dhcp, what distro are you using?
 
even so, behind a dhcp server you should be able to HC your IP and it will work just fine. As long as you dont shut your machine down for long periods of time your router will keep it's mac address in it's arp table and shouldnt assign out that IP anywhere else. You could also avoid any IP conflicts by setting your IP to something that will never get assigned 2-99 as ICSVortex suggested, or something higher that has a very low probilbility of getting assigned.

-Spy
 
Well the thing is, I only have two computers. My desktop, and my server. I bootup my desktop first so it gets the 192.168.1.100 ip, then next my server 192.168.1.101. I turn off my desktop but my server is on. It had that 101 ip for a week, then all the sudden it changed to 102. I checked out teh server, and the dhcp release is set for 50000 days.... Hmm I'm on Mandrake 8.2, and i use DHCP. Mandrake detected my ip so im sort of lost on how to change it to static IN CONSOLE. Id like to learn this hehe.

Thanks
 
I dont remember, it's been a long time since I've done it from a consol.

"ifconfig en0 down" than do a "man ifconfig" and see if you can figure out how to set it statically, than lastly do an "ifconfig en0 up" make sure to replace en0 with whatever the name of your network interface is, you could do an "ifconfig all" to have it list all of them.

hope my syntax is correct, like I said it's been a while.

Good Luck

-Spy
 
Originally posted by: Kai4Linux
Well the thing is, could i still connect as my router acts as a dhcp router and gateway so.. would it still go through?
Sure, just make sure you set your router's IP as your GW and that your on the same network.

-Spy
 
The router will do dhcp and static at the same time regardless of what linksys says. Just set the router to assign dhcp to addresses starting .100 then any machine you want static assign the address starting at .10. Works every time. You will have to change the configuration on your machine of course.
Bleep
 
.10? You mean 192.168.1.10... so ifconfig eth0 192.168.1.11 255.255.255.0?

I just checked out man ifconfig, it says how to put the ip in, but nothing about static.. .and mandrake overwrites it with dhcp i think on startup.

 

find -name "ifconfig*" -print
and edit the dhcp range, and leave a small range for static.

Debian: /etc/network/interfaces
 
find -name "ifconfig*" -print

I tried that nothing outputed. Mandrake uses a script called dhcpd.exe (don't ask), which gets your ip and all. I did a man of it, and nothing in their would let you get an ip. Any ideas? thx
 
If mandrake is still a RH clone, you need to edit the /etc/sysconfig/network-scripts/ifcfg-eth0 file to say proto=static and then address=whatever.you.want.ittobe and netmask=whatever...
 
Back
Top