×

Welcome to TagMyCode

Please login or create account to add a snippet.
1
0
 
0
Language: Bash
Posted by: Paul Allies Allies
Added: Jul 8, 2012 3:15 PM
Modified: Sep 5, 2012 8:28 PM
Views: 38
Tags: no tags
Here we are gonna change the dhcp assigned ip address to a static ip address of 10.0.0.11
  1. //Display existing network configuration.  This will display the network configs for the machine.
  2. //Not the lo which is the loopback config.
  3. $ netstat -i
  4.  
  5. //edit the /etc/network/interfaces
  6. $ sudo vim /etc/network/interfaces
  7.  
  8. //comment out the dhcp setting and add the static setting.
  9. iface lo inet loopback
  10. #iface eth0 inet dhcp
  11. iface eth0 inet static
  12. address 192.168.1.4
  13. netmask 255.255.255.0
  14. network 192.168.1.0
  15. broadcast 192.168.1.255
  16. gateway 192.168.1.1
  17.  
  18. //restart network config
  19. $ /etc/init.d/networking restart
  20.  
  21. //set the nameserver(Ubuntu)
  22. sudo vim /etc/resolvconf/resolv.conf.d/tail
  23. //add the following line
  24. nameserver 192.168.1.1
  25. //restart resolv
  26. sudo /etc/init.d/resolvconf restart
  27.