How does one use DHCP to get the same IP address assigned every time on openSUSE
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How does one use DHCP to get the same IP address assigned every time on openSUSE
I have a cable-modem / router that allows me to reserve an IP address for a particular MAC address - I have used this method to assign a "static-like" IP address to all my webCAMS, Windows boxes etc even though these devices themselves use DHCP to get IP addresses assigned from the router. I can'r seem to be able to do this with my openSUSE linux box. If I use Yast and configure my system for Static IP the router doesn't even know the machine exists. If I reserve an IP address (192.168.0.203) based on the MAC address of the Linux box and use DHCP, the router thinks it has assigned the correct IP address (192.168.0.203) to the Linux box but when I run ifconfig on the linux box it shows a completely different IP address (192.168.0.177)! I need my Linux Box to get the same IP address assigned so that I can use SAMBA, VNC Viewer etc from my windows machine - How can I achieve this ?
I'm not sure I understood.
I think you should do like this: you should instruct your router to always send answers to dhcp, and to send the same IP address for MAC addresses of your choice. Then, you should leave DHCP on all machines connected to the router. They will get the IP address automatically from the router
dhcp by definition is dynamic. use static, you dont need to change the setting on your router and the ip will always be the same this will work on all routers.
go to yast - network devices - network cards. click on your card,then click on edit & fill in the details
the only thing you might need to change is the ip you want and the gateway whereas the gateway is the address you would type in to access your routers setup page
oh also if your looking to access stuff ie the vnc from outside your network make sure to setup port forwarding , one more reason to have a static IP so you dont end up changing it every time you dhcp lease is up
Now I get my desired IP address of 192.168.0.177 assigned to me from the router all the time. And, since I've done all the proper Port Forwarding and firewall configuration on my router I can ftp or ssh OR VNC into my linux box from just about anywhere - Very happy
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.