LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-05-2007, 11:11 AM   #1
Jzarecta
Member
 
Registered: Dec 2005
Location: Villahermosa, Bucharest, Birminham, Brooklyn, Beverly
Distribution: Mandriva
Posts: 118

Rep: Reputation: 15
Wink Can I add static ip per environment.


I have a handheld device (Nokia 800) running Linux. I am usually in DHCP environments. However I wonder if I would configure the network per environments without having to modify the back end. Since I just want to static ip on my home network I guess I can assign something like 192.168.2.82 given that I will never accumulate to have a 81 machines requesting ip from the router DHCP.

So my question is how to assign 192.168.2.82 just on my home network without having to change the Router DHCP and still be able to have a dynamic ip on the rest of the networks?

Any ideas....

BTW this is something that already works since for XYZ reason my router assign 192.168.2.2 to my handheld regardless if my laptops connects first or latter. I just wonder if I actually did this odd configuration without even realizing.
 
Old 10-05-2007, 11:59 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well a dhcp router would have a range of addresses, e.g 192.168.2.10 to 192.168.2.100, if you are outside of those ranges, you can always use whatever ip address you want. most routers allow for specific exclusions too, but that's down to the router you have.
 
Old 10-05-2007, 01:21 PM   #3
Jzarecta
Member
 
Registered: Dec 2005
Location: Villahermosa, Bucharest, Birminham, Brooklyn, Beverly
Distribution: Mandriva
Posts: 118

Original Poster
Rep: Reputation: 15
Thanks but I guess you missed my question. Yes a DHCP router works usually like that. However I want to discover how can I am wonder what makes my device get the same IP regardless of the order of the connection.

I just thought about it and I think the answer is the following:

The router has a 4 port wired... so my guess is that the router allocates the first 4 ports to 192.168.x.[1,2,3,4] and that makes the ip be the same regardless if one devices ask for the IP before the other.

However if this is true, is odd that the wifi is on 192.168.2.2 (since it doesnt require a cable port).

Oh well... just odd.
 
Old 10-05-2007, 01:56 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well that's just how DHCP works. the server holds a lease for a given MAC address and should that client connect again then the router recognizes it and uses that same detail. additionally, many dhcp clients record what IP they had last and expressly request that IP from the network.
 
Old 10-05-2007, 11:11 PM   #5
Jzarecta
Member
 
Registered: Dec 2005
Location: Villahermosa, Bucharest, Birminham, Brooklyn, Beverly
Distribution: Mandriva
Posts: 118

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by acid_kewpie View Post
well that's just how DHCP works. the server holds a lease for a given MAC address and should that client connect again then the router recognizes it and uses that same detail. additionally, many dhcp clients record what IP they had last and expressly request that IP from the network.
Ok interesting, how reliable is that? Can i add that IP to my /etc/hosts file so I can map the handheld and laptop?

I know a DNS server or a static ip might be a more stable solution but for just a network of 4 computers.
 
Old 10-06-2007, 01:22 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well there's no guarentee at any stage, it's purely what is usually done... if there's no contention for ip addresses it would often never change, but it's open to many subtle changes in each implementation
 
  


Reply

Tags
dhcp, dns, handhelds, ip, n800, routers, wifi


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
permanently add static route glock19 Linux - Networking 27 07-27-2015 04:59 PM
How to add a multicast static route in centOS4.4 dozer Linux - Networking 2 08-05-2011 03:09 PM
Linking static and shared libraries in the KDevelop Environment tristanm Programming 15 11-27-2006 09:59 PM
Add a new Desktop Environment justintime32 Mandriva 5 02-26-2005 12:19 PM
need to add static dns record silvereye Linux - Software 10 12-20-2004 10:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration