set static IP from command line in Ubuntu

/ Published in: Other
Save to your folder(s)

from google search
change in /etc/network/interfaces
in this case static IP is
afterwards, restart network interfaces: sudo /etc/init.d/networking restart

Copy this code and paste it in your HTML
  1. # This file describes the network interfaces available on your system
  2. # and how to activate them. For more information, see interfaces(5).
  4. # The loopback network interface
  5. auto lo
  6. iface lo inet loopback
  8. # This is a list of hotpluggable network interfaces.
  9. # They will be activated automatically by the hotplug subsystem.
  10. mapping hotplug
  11. script grep
  12. map eth0
  14. # The primary network interface
  15. iface eth0 inet static
  16. address
  17. netmask
  18. gateway


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.