Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Finding a computer with dynamic IP

  1. #1
    Mentor
    Join Date
    Jun 2001
    Posts
    1,672

    Finding a computer with dynamic IP

    Here is the scenario:

    I have a bunch of Linux boxes on a LAN. Each gets it's IP from a DHCP server. The IP address of any computer might change after a reboot. I need to get files from "ComputerA" like "mount -t nfs ComputerA:/home /mnt". I could edit /etc/hosts to resolve "ComputerA" to it's IP address, but it won't work any more if the IP address changes.
    In a Windows environment I can connect to any computer by it's name without knowing it's IP address. How can I achieve this in a Linux environment?

  2. #2

    Re:Finding a computer with dynamic IP

    The way windows does this is using the NMB protocol, you can run that on linux, and use samba instead of nfs, or even use nfs with it but maybe not as seemless.

    Configure your hostname in smbd.conf then run nmbd. Then on your second computer run nmblookup YOURHOSTNAME

    That /should/ give you the ip of the first. With samba if you are running nmbd you can then just do mount -t smb //HOSTNAME/share /mnt/samba

    I'm afraid I don't know enough about nfs to do it with nfs, but you could nmblookup and then use the ip you get from there, but that's kinda sloppy.

  3. #3

    Re:Finding a computer with dynamic IP

    Is your router acting as a DHCP server? If so, what type of router are you using? I am asking this because some routers support assigning static IPs for computers on the network.

  4. #4
    Mentor
    Join Date
    Jun 2001
    Posts
    1,672

    Re:Finding a computer with dynamic IP

    [quote author=chessforce link=board=4;threadid=8996;start=#msg81338 date=1081540717]
    Is your router acting as a DHCP server? If so, what type of router are you using? I am asking this because some routers support assigning static IPs for computers on the network.
    [/quote]

    I have a Linux box acting as the router/firewall/dhcp server, so my setup is very flexible. I'm running dhcpd.

  5. #5

    Re:Finding a computer with dynamic IP

    [quote author=cloverm link=board=4;threadid=8996;start=0#msg81340 date=1081541072]
    [quote author=chessforce link=board=4;threadid=8996;start=#msg81338 date=1081540717]
    Is your router acting as a DHCP server? If so, what type of router are you using? I am asking this because some routers support assigning static IPs for computers on the network.
    [/quote]

    I have a Linux box acting as the router/firewall/dhcp server, so my setup is very flexible. I'm running dhcpd.
    [/quote]

    Ok, I see. I was wondering whether you were running a Linksys, 3Com, etc. router. Anyways, you can try http://www.comptechdoc.org/os/linux/...ugrouting.html to see if there is anything useful there.

  6. #6
    Mentor
    Join Date
    May 2001
    Location
    New Jersey
    Posts
    1,473

    Re:Finding a computer with dynamic IP

    cloverm, i have an idea.

    If you set the lease of the dchp ip address for a long time like maybe 30 days or longer. Each machine should keep it's address even after a reboot. Dosent the machine renew it's address when the lease is half over or it notifies the dhcp server that it's still here and keep giving me the address, dont quote me on this but i'm pretty sure.

    look in to the lenght of the lease of the ip address i'm VERY sure there is a way to keep ip's for a long time.

  7. #7

    Re:Finding a computer with dynamic IP

    Why not just assign fixed addresses?

  8. #8

    Re:Finding a computer with dynamic IP

    Ever think of resolving with MAC addresses? Try out arpwatch to find the IPs of your dynamic hosts.

  9. #9
    Moderator
    Good Guru
    Schotty's Avatar
    Join Date
    Jul 2001
    Location
    Milwaukee, WI
    Posts
    5,760

    Re:Finding a computer with dynamic IP

    Do what Master Copy said. Thats how I do it. Pretty simple. Any PC that may run a daemon or a game server will be a static IP.

  10. #10

    Re:Finding a computer with dynamic IP

    If you are running your own dhcp server you have some options.

    You could setup a dns server on the same server, and even set it so that it gets the name send by the dhcp client to the dhcp server and puts that into dns for your local domain.

    But I don't actually know how to do that because I haven't had the need, but I know you /can/ do it.

Similar Threads

  1. Dynamic Disk
    By omidkamangar in forum Linux - General Topics
    Replies: 2
    Last Post: 10-02-2006, 04:05 PM
  2. Dynamic IP
    By jro in forum Linux - General Topics
    Replies: 13
    Last Post: 08-09-2005, 01:43 PM
  3. Dynamic DNS
    By pyfsapple in forum Linux - Hardware, Networking & Security
    Replies: 0
    Last Post: 01-17-2003, 10:19 AM
  4. Webserver on dynamic IP
    By gmoreno in forum Linux - Hardware, Networking & Security
    Replies: 9
    Last Post: 08-18-2002, 04:32 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •