LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 05-07-2009, 04:39 PM   #1
rai6996
LQ Newbie
 
Registered: May 2009
Location: Bellevue , WA
Distribution: openSUSE 10.3
Posts: 2

Rep: Reputation: 0
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 ?

thanks much.
 
Old 05-08-2009, 01:35 PM   #2
clvic
Member
 
Registered: Feb 2008
Location: Rome, Italy
Distribution: OpenSuSE 11.x, vectorlinux, slax, Sabayon
Posts: 206
Blog Entries: 2

Rep: Reputation: 45
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
 
Old 05-08-2009, 03:35 PM   #3
jkzfixme
Member
 
Registered: Sep 2006
Location: Orange County, NY
Distribution: Ubuntu, Solaris, Android
Posts: 329
Blog Entries: 21

Rep: Reputation: 52
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

Quote:
IPADDR='192.168.0.203'
BROADCAST='192.168.0.255'
NETMASK='255.255.255.0'
NETWORK='192.168.0.0'
GATEWAY='192.168.0.1'
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

Regards
JKZfixme

Last edited by jkzfixme; 05-08-2009 at 03:37 PM.
 
Old 05-08-2009, 03:38 PM   #4
jkzfixme
Member
 
Registered: Sep 2006
Location: Orange County, NY
Distribution: Ubuntu, Solaris, Android
Posts: 329
Blog Entries: 21

Rep: Reputation: 52
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

Regards,
JKZfixme
 
Old 05-09-2009, 01:49 PM   #5
rai6996
LQ Newbie
 
Registered: May 2009
Location: Bellevue , WA
Distribution: openSUSE 10.3
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks all who attempted to answer my convoluted question - I did fix the problem - It was pretty simple after digging around a bit :

I edited the /etc/dhclient.conf file to include the following:

interface "eth0" {
send host-name "lin64quad";
send dhcp-requested-address 192.168.0.177;
}

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
 
  


Reply


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
Set IP address to static from DHCP assigned address jborn Linux - Networking 4 02-02-2007 08:38 PM
eth0 ip assigned by dhcp , how would i know the ip address of the dhcp server where.. kublador Linux - Networking 14 05-16-2006 06:33 AM
DHCP Server MAC Address found, IP address not assigned wmburke Linux - Wireless Networking 17 11-17-2004 10:33 AM
dhcp assigned address nilbog Linux - Networking 4 04-02-2003 11:17 AM
How to find out my IP address on a DHCP IP Assigned machine? simonh Linux - Networking 2 12-10-2002 05:49 AM


All times are GMT -5. The time now is 07:23 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration