-1

Scenario: In general a ubuntu machine (called server) runs in a network and gets an IP from it. Due to testing, sometimes a windows machine (client) is physical connected to the ubuntu machine exclusively. (Because the server is mounted on a car trailer and there is sometimes no existing network availible.)

It should run without any regular effort on the server.

Situation now: Because noone runs a DHCP server both will get a zeroconf (169.254.x.x) address. The problem is that Windows don't resolve names via mDNS otherwise I could simply use avahi.

My thoughts for solutions are

  • server side
    • after DHCP discover timout start an own DHCP server serving an IP for the client
    • use static IP (zeroconf subnet) on DHCP discover timeout (thus client knows it)
  • windows side
    • install mDNS or Bonjour :( respectively
  • both sides
    • use static IPs (annoys and error-prone at the client side)

Do I consider all sorts of solutions? If yes which one seems to be the best? Ideally I don't want to install extra software on windows and don't set a static IP on the client all the time. So setting a static zeroconf address on the server seems to be the best?

1
  • Why the heck people downvote a question and didn't leave a short comment whats wrong? – wenzul Oct 20 '14 at 4:02
1

Try using the samba package. You may need to install libnss-windbind as well. This should enable using WINS as a name service. You will need to add wins to the hosts entry in /etc/nsswitch.conf.

I have the bonjour package installed on a Window system, but its address is not available. Media services are announce, but only have the machine name.

Adding a static IP to the Windows system would be fairly easy. Using an entry in /etc/hosts would make accessing the system by name simple. This could be done on both systems. If you pick addresses in networks like 192.168.255.0/24, 172.31.255.0/24, or 10.255.255.0/24 you should have a low risk of address collision when you are connected to a network. Adding the addresses as secondary address should allow the addresses to work even when you are getting a zero-conf address.

0

Why not set a static IP address on the Linux server in it's production subnet and set the 'Alternate Configuration' on the Windows machine (with DHCP enabled) on that same subnet? Then when DHCP fails on the Windows machine it doesn't end up with a 169.254.x.x address.

For the DNS issue you could hard-code the server name/IP in the hosts file as @BillThor mentions, or run DNS on the Linux machine. Either is preferable to WINS.

It's a statically configured design, but provides consistent addressing for the server and permits the client to utilize DHCP on other networks.

1
  • Thank you for your answer. 169.254.x.x is no problem for me. Because I don't know who is connecting to the server in the future it would be easier not to configure anything on that varying clients. Because they have to think about... what IP should I set bla... do you get my point? I try to avoid it, but if it's not possible I have to set an IP otherwise. The easiest case would be, plug in, type the hostname, go. – wenzul Oct 20 '14 at 11:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.