You are not logged in.

#1 2012-02-22 12:51:40

kevin89
Arch Linux f@h Team Member
From: Netherlands
Registered: 2007-03-14
Posts: 218

[Solved] Static IP using DHCP for NFS share

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

#2 2012-02-22 13:15:53

Awebb
Member
Registered: 2010-05-06
Posts: 6,383

Re: [Solved] Static IP using DHCP for NFS share

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

#3 2012-02-22 13:30:40

kevin89
Arch Linux f@h Team Member
From: Netherlands
Registered: 2007-03-14
Posts: 218

Re: [Solved] Static IP using DHCP for NFS share

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

#4 2012-02-22 13:58:40

vacant
Member
From: downstairs
Registered: 2004-11-05
Posts: 816

Re: [Solved] Static IP using DHCP for NFS share

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

#5 2012-02-22 14:11:03

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [Solved] Static IP using DHCP for NFS share

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

#6 2012-02-22 14:27:42

kevin89
Arch Linux f@h Team Member
From: Netherlands
Registered: 2007-03-14
Posts: 218

Re: [Solved] Static IP using DHCP for NFS share

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

#7 2012-02-22 14:29:54

Awebb
Member
Registered: 2010-05-06
Posts: 6,383

Re: [Solved] Static IP using DHCP for NFS share

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

#8 2012-02-22 14:32:43

kevin89
Arch Linux f@h Team Member
From: Netherlands
Registered: 2007-03-14
Posts: 218

Re: [Solved] Static IP using DHCP for NFS share

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

Board footer

Powered by FluxBB