This question already has an answer here:

i configured master and slave setup. but some times after restart the machines wired ip address changes. how to set a static ip step by step. please help me thank you.

marked as duplicate by Warren Hill, Eric Carvalho, Tim, Andrea Corbellini, Radu Rădeanu Aug 20 '14 at 16:58

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  1. sudo -s
  2. ip link show
  3. chose your network interface
  4. nano /etc/network/interfaces
  5. allow-hotplug nameOfYourNetworkInterface iface nameOfYourNetworkInterface inet static address yourIPAddress netmask yourMask gateway yourGateway dns-nameservers IPAddressOfYourDNSServer IPAddressOfYourSecondDNSServer

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