Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Specs

OS: Ubuntu 12.0.4 Server
Router: Netgear Genie WNDR3700v2

Goal

To give my Ubuntu server a static ip address so I could eventually forward a router port to it and make it accessible via the internet.

Background

I disabled ipv6 by adding the below lines to the bottom of my /etc/sysctl.conf:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

Problem

Once I setup a static ip using the below /etc/network/interfaces file, I can't connect to the internet.

/etc/network/interfaces

  1 # This file describes the network interfaces available on your system
  2 # and how to activate them. For more information, see interfaces(5).
  3 
  4 # The loopback network interface
  5 auto lo
  6 iface lo inet loopback
  7 
  8 # The primary network interface
  9 auto eth0
 10 iface eth0 inet static
 11 address 192.168.0.111
 12 netmask 255.255.255.0
 13 gateway 192.168.0.0
 14 network 192.168.0.1
 15 broadcast 192.168.0.255
 16 dns-nameservers 192.168.0.1
 17 
 18 # This is an autoconfigured IPv6 interface
 19 # iface eth0 inet6 auto

Any ideas or suggestions for troubleshooting this would be greatly appreciated.

share|improve this question
1  
Are you sure you don't have the gateway (192.168.0.0) and network (192.168.0.1) addresses switched around? –  steeldriver Jan 5 at 3:17
    
Nope, tried switching them, and setting both to .1 and 'sudo ifup -a' still returns 'failed to bring up eth0' –  James Nicholson Jan 5 at 3:23

1 Answer 1

I was able to fix this by changing the below field in my /etc/network/interfaces file:

address 192.168.0.222

Turns out that the previous value of 192.168.0.111 was in the range reserved for DHCP by my router.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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