[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

dhclient assigns new IP address every time



My computer is behind a router (linksys BEFSR41). The computer and the router are connected by ethernet cable (ie no wireless). Every time I run, 'sudo dhclient', the IP address assigned to the computer is different. For example, sometimes I get 192.168.1.101, 192.168.1.100, 192.168.1.102 etc., Is there any way to always get the same IP address assigned when I run dhclient? If dhclient cannot do this, are there any other alternatives?

Complete story:
This is my actual situation. I need to ssh into my computer which is behind the router (linksys BEFSR41). So I have set up port forwarding to forward all the ssh requests to say 192.168.1.101 . But then the dhcp lease expires every 1 day or so and the computer gets new IP address. Once it gets new IP address, I wont be able to connect the computer as all the ssh requests are being directed to 192.168.1.101

I dont think there is any way to assign MAC addresses for port forwarding instead of the IP addresses using this router. I also tried to change the release expiration value (in the router's console) to a very high value, but even then the internal IP address changes quite frequently. After giving up on the router, I though I will use dhclient and run it as a cron job provided it gets the same IP address. But dhclient itself gives me different IP address each time it is run.

Any other ideas on how to overcome the above problem? Is there any other sensible router out there which does not have this problem? I heard a lot about Linksys WRT54G. Does it also have the same problem?

thanks
raju

--
Kamaraju S Kusumanchi
http://www.people.cornell.edu/pages/kk288/
http://malayamaarutham.blogspot.com/



Reply to: