I can create a network between my ubuntu 14.04 and another machine by connecting ethernet cable between my ubuntu machine and second machine, and then setting "IPv4" to "share to other computers". The network created has IP that's something like 10.42.0.x. I'm doing this not to share internet, but to create a network between two machines, and this works very well.
For the two machines to address each other using hostname, I'd edit their /etc/hosts with respective IPs. I'd like this to be simpler, using MAC to IP mapping that's found in modern routers. What would be the easiest way to accomplish this?
Best Answer
Typically, IP address assignment based on MAC is achieved via a DHCP server and its configuration file in
/etc/dhcp/dhcpd.conf
. The below example reserves a pool of IP addresses for guests, and the rest are assigned based on MAC:Alternatively, and if you prefer to use dnsmasq, or are already using it by default, you can specify via MAC in
/etc/dnsmasq.conf
via:Disclaimer: I am actually not familiar with dnsmasq, but the DHCP example is directly from my system.