Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

So here's the deal. My router assigns ip addresses starting from 192.168.0.50. I have a couple of computers running ubuntu which i want the router to assign 192.168.0.50 and 192.168.0.51 every time they request for an ip address. Any ideas? Thanks in advance.:)

share|improve this question

3 Answers 3

up vote 3 down vote accepted

You have a few options.

1) DHCP reservations on your router. Some routers have this look around in the settings.

2) I'm pretty sure if you go to networking manager you can set a manual ip, but still be on DHCP. I mostly use cli.

3) Set a staic ip with this guide http://www.howtogeek.com/howto/ubuntu/change-ubuntu-server-from-dhcp-to-a-static-ip-address/

share|improve this answer

using the linux program dhclient.

If you don't have linux installed, you can use a bootable Linux live CD.

[edit] If you do this trick to create an address reservation for an actual Windows machine, first switch the NIC in Windows to a static IP, because after a reboot in DHCP mode Windows may send a DHCP request with its last used IP, which would annihilate your efforts with dhclient below...

The trick is to send a DHCP request with your desired IP address from the same NIC (or better: same MAC address).

Edit the /etc/dhcp/dhclient.conf and add the following line (you might have to first copy the file to a writeable location if booting from a CD):

send dhcp-requested-address 192.168.1.240;

Then stop and start dhclient as user root, where your NIC is eth0 (check by issuing ip addr show beforehand)

dhclient -r -v
dhclient -4 -d -v -cf /etc/dhcp/dhclient.conf eth0

If successfull, your DHCP server will fulfill your prepared request. Sometimes you will have to delete the device entry in the DHCP table before issuing dhclient -4 -d ....

Then make that device IP address in the DHCP table of the router a fix address reservation. This will associate the IP to the MAC of the device and return the same IP everytime a DHCP request with that MAC address is encountered in the future.

Source

share|improve this answer

The simplest thing to do is to set computer A to a static IP of 192.168.0.50 and computer B to a static IP of 192.168.0.51 and configure your router to send DHCP addresses starting at 192.168.0.52 instead of 192.168.0.50. You may also wish to reserve addresses as outlined by wlraider70

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.
{"cc_re__cc_re__cc_by_sa_3_0": ["                  <li><a href=\"//area51.stackexchange.com\" title=\"proposing new sites in the Stack Exchange network\">Area 51</a></li>\r\n                        <li><a href=\"//careers.stackoverflow.com\">Stack Overflow Careers</a></li>\r\n                    \r\n                </ol>\r\n            </td>\r\n    </tr>\r\n</table>\r\n                </div>\r\n            </div>\r\n\r\n            <div id=\"copyright\">\r\n                site design / logo &#169; 2015 stack exchange inc; user contributions licensed under <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a> \r\n                with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\r\n            </div>\r\n            <div id=\"svnrev\">\r\n                rev 2015.4.27.2529\r\n            </div>\r\n                <div id=\"additional-notices\">\r\n                    Ubuntu and Canonical are registered trademarks of Canonical Ltd.\r\n                </div>\r\n            \r\n        </div>\r\n    </div>\r\n    <noscript>\r\n        <div id=\"noscript-wa"], "copyright__copyright__copyright": ["lest thing to do is to set computer A to a static IP of 192.168.0.50 and computer B to a static IP of 192.168.0.51 and configure your router to send DHCP addresses starting at 192.168.0.52 instead of 192.168.0.50. You may also wish to reserve addresses as outlined by wlraider70\n\nshare|improve this answer\n\nYour Answer\n\n\u00a0\ndiscard\n\nBy posting your answer, you agree to the privacy policy and terms of service.\n\nNot the answer you're looking for? Browse other questions tagged or ask your own question."]}