Announcement

Collapse
No announcement yet.

nfs and DHCP

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    nfs and DHCP

    My nfs configuration files (exports, hosts.allow and fstab) all require numeric IP addresses (I think I read that somewhere).

    But my router has a nasty habit of sometimes changing the numeric addresses of the computers plugged in. Usually when 1 has been turned off for a few days.

    My computers have the names my-net, her-net and her-net-old. I would like to use the computer names which are listed on the router with their corresponding numeric addresses.

    Can I get Linux and nfs to utilitze the alpha-numeric names instead of the strictly numeric names?

    I have tried to get the alpha-numeric names recognized, but I have failed to do so. For example if I type:

    host her-net
    Host her-net not found: 3(NXDOMAIN)

    So the alpha-numeric name isn't recognized. How do I get Linux/nfs to do so?

    #2
    What's you router model? Most support assigning IP to MAC.

    Please Read Me

    Comment


      #3
      Originally posted by oshunluvr View Post
      What's you router model? Most support assigning IP to MAC.
      Verizon/Actiontec MI424WR Rev 1

      Comment


        #4
        You can make static assignments under Advanced -> IP Address Distribution -> Connection List -> New Static Connection. Add in a hostname, IP address, and MAC address and you'll be set.

        Please Read Me

        Comment


          #5
          I think I may have found a solution without changing anything on the router.

          In exploring I was studying the web page for my HP LaserJet. It listed it's domain name as: printer_name.local

          That ".local" piqued my interest, so I did some experimenting with ping. I tried:

          ping -c 4 her-net

          No luck as usual. So I tried

          ping -c 4 her-net.local

          Success!

          So the local net is in the name space under ".local"

          I changed all of the IP addresses in fstab, exports and hosts.allow to the computer name with the ".local" added.

          That enabled the translation from domain name to IP address and everything worked.

          Comment


            #6
            I seems I was premature on this.

            Rebooted again and it didn't work.

            Maybe some day I'll find out what is going on, but for now I followed oshluvr's advice and simply went in and converted all of the dynamic connections to static connections. Bring up the list of connections as you advised and then click on the icon to edit a connection. In the new dialog there is a check box to convert the connection to "static". Clicked that for all of the current connections. They are now static. Any new connections will be dynamic.

            Using the name.local worked for some applications and not for others. Even for those for which it worked, it didn't do so consistently.

            For ssh and ping, using name.local worked and worked every time. On the desktop, for fstab, exports it worked the first time and kinda a few other times, but also for some times it didn't work at all. And when I converted the fstab, exports, and hosts.allow files to name.local on the laptop, it was so bad that the laptop hung during Kubuntu boot. Had to use the magic key sequence to reboot into a single user mode and copy all of the original files back over the working files and then reboot.

            So using name.local works for some apps, works maybe/kinda for some and is really bad for others. I guess it depends on how they convert domain name to IP address.

            Comment


              #7
              Originally posted by geezer View Post
              My nfs configuration files (exports, hosts.allow and fstab) all require numeric IP addresses (I think I read that somewhere).

              But my router has a nasty habit of sometimes changing the numeric addresses of the computers plugged in. Usually when 1 has been turned off for a few days.
              If all the client machines are in the same subnet, I would use a subnet address in /etc/exports:
              Code:
              /srv/sharename     192.168.1.0/24(rw,etc.)
              Then as long as the machines get addresses within that subnet, they'll be able to connect.

              I run a local DNS server in my home office so I can't help with the .local business.

              Comment


                #8
                Originally posted by SeijiSensei View Post
                If all the client machines are in the same subnet, I would use a subnet address in /etc/exports:
                Code:
                /srv/sharename     192.168.1.0/24(rw,etc.)
                Then as long as the machines get addresses within that subnet, they'll be able to connect.
                Not too sure what you mean by this. Could you elaborate, Please?

                Comment


                  #9
                  Originally posted by SeijiSensei View Post
                  If all the client machines are in the same subnet, I would use a subnet address in /etc/exports:
                  Code:
                  /srv/sharename     192.168.1.0/24(rw,etc.)
                  Then as long as the machines get addresses within that subnet, they'll be able to connect.

                  I run a local DNS server in my home office so I can't help with the .local business.
                  While I agree this is the proper way to export over a local network, my understanding of the OP was the nfs server was changing IP address due to router based DHCP. The simplest solution in this case is to have the server use a fixed IP. I don't think he was having trouble with the exports, just the floating IP.

                  For example, running showmount -e without a specific IP results in clnt_create: RPC: Unknown host

                  Please Read Me

                  Comment


                    #10
                    BTW, geezer, another solution to DHCP is to narrow the DCHP IP range on the router and then manually assign fixed IP's outside that range to your desired machines. Editing /etc/interfaces will do that.

                    @Here, my router uses ...2 to ...198 for DHCP and I use ...199 and above for my fixed IPs. It makes sense to me that fixed devices should have fixed IPs, so my desktop and server use static address while the laptops and other devices use the DHCP service.

                    Please Read Me

                    Comment

                    Working...
                    X