You are not logged in.
Hello there,
I've successfully set up a NFS share on my desktop, which is used by my NFS client (which is a mediaplayer, Mede8er to be specific).
The trouble I have is my desktop gets a new IP assigned by DHCP on every boot. This means I have to manually change this on my mediaplayer.
Obviously, this gets annoying. I've tried the suggestion in the wiki to edit my /etc/conf.d/dhcpcd.
The relevant line is:
DHCPCD_ARGS="-q -s 192.168.1.97"
However, I can't access the internet using this configuration. The command ip addr shows that I have been assigned the IP specified in the configuration file, but I can't seem to connect to the internet.
I wasn't able to find much information on setting a static IP using DHCP, hence my question: What do I do to correctly assign the same internal IP with DHCP to my desktop?
Cheers
Last edited by kevin89 (2012-02-22 14:27:56)
Offline
dhcpcd is not the dhcp server, but the daemon of the dhcp client running on your client machine. You have two options:
1. Configure a static IP adress in your rc.conf.
2. Configure your dhcp server (in your router or whereever) to assign the same IP address to the same NIC (using the same MAC) on every request.
DHCP servers usually assign the same IP to the same clients unless they're told not to. I'd check the server's configuration.
Offline
Thanks for your post. I always use dhcp and dhcpcd together like they're the same, although I do know the difference.
I'm going to try configuring rc.conf for a static IP, since my router has afaik no capability of your second suggestion. I'll report back.
Offline
Your router's DHCP server will be assigning IP addresses from a pool, e.g. 192.168.1.3 to 192.168.1.254.
So... reduce the address pool e.g. 192.68.1.3 to 192.168.1.99 and in your desktop's rc.conf assign a static ip address outside that pool e.g. 192.168.1.100 (but still inside the router's lan subnet).
Offline
You will also have to manually configure your resolv.conf if you use a static IP. At least, I always have.
In fact, that was probably why you had no internet when you used
DHCPCD_ARGS="-q -s 192.168.1.97"
Your machine didn't know any DNS servers.
Last edited by alphaniner (2012-02-22 14:12:22)
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
Thanks for the informative responses.
I've got it working now. However, the road was quite bumpy.
I tried adding a static IP outside of my dhpc pool to my /etc/rc.conf. This resulted in no working Internet. However, on my routers page a new option appeared: 'Always use this address'
This option only is there when not using dhcp. So I went ahead and ticked that box. Still no internet though.
What I did to get it working:
1. Set static IP in rc.conf
2. Check box 'Always use this address' (which was not there before setting static IP) in router
3. Set dhcp in rc.conf
4. Add a line in /etc/conf.d/dhcpcd
Now my dhcp server always assigns me the same address. It may not be the best approach, but hey - it worked. I blame the mysterious disappearing 'Always use this address' box in my router.
Thanks for the help.
Offline
So the option was only there when you forced an IP on your client? Could you tell us the brand of the router, so I can avoid buying their stuff? :-D
Offline
Yeah it basically comes down to a not so awesome router/modem. It's the Thomson TG712.
Last edited by kevin89 (2012-02-22 14:33:08)
Offline