Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to give my server a static IP address. This seems to work without any problems, but I can't seem to get an internet connection after this process. I've also changed my DNS server to 8.8.8.8 (google dns right?).

OS: Ubuntu Server 12.04 x86
Environment: Virtualbox
File: /etc/network/interfaces:

auto eth0
iface eth0 inet static
    address 192.168.2.10
    netmask 255.255.255.0
    network 192.168.2.0
    broadcast 192.168.2.255
    gateway 192.168.2.1

FIXED
I've fixed the issue myself, it appeared my router settings had changed somehow, it was set to the 10.x.x.x range instead of the 192.x.x.x

share|improve this question
1  
Steps I would take to troubleshoot, try to ping yourself(192.168.2.10) if that works, try to ping the gateway(192.168.2.1) if that works, do an nslookup on google.com and see if it is able to resolve it and let us know the results. –  Lipongo Sep 15 '12 at 15:39
    
@Lipongo Huh..? –  FoxyShadoww Sep 15 '12 at 15:40
    
Hit enter by mistake, just updated the comment. –  Lipongo Sep 15 '12 at 15:40
    
I can ping them, but doe you have an example on the nslookup command? –  FoxyShadoww Sep 15 '12 at 16:04
    
type nslookup google.com at the command line and comment with the output. –  Lipongo Sep 15 '12 at 16:14
show 1 more comment

3 Answers

up vote 0 down vote accepted

I've fixed the issue myself, it appeared my router settings had changed somehow, it was set to the 10.x.x.x range instead of the 192.x.x.x

share|improve this answer
add comment

Look at your DHCP server and gateway it might be that they block unregistered devices from gaining access to the Internet.

But the better way to give static IPs in a DHCP environment is to configure the DHCP to reserve the chosen IP for a certain device; you'll definitely need to exclude the chosen IP from the pool for available IP addresses either way.

share|improve this answer
    
I've disabled DHCP in the Virtualbox settings. –  FoxyShadoww Sep 15 '12 at 18:07
add comment

Don't forget about ports or port forwarding if you're trying to do something fancy and want access from the Internet (serving web pages are you?) - or even access to the internet (have a proxy to consider?).

I like Zoredache's answer. You probably do want to configure your router to reserve a certain IP range so that you can statically assign IP's in one range while allowing DHCP to assign IPs for another (this is not class "segmenting" where you may have to figure out different netmasks for completely separate internal LAN's).

I can only state what I've done for myself where I split my DHCP and static IP ranges by assigning the DHCP range in my class C LAN to start at 192.168.1.100 rather than let it start at the default of 192.168.1.2. That way, I can statically assign IP addresses to devices from 192.168.1.2 to 192.168.1.99. Of course, I could statically assign IP's within my DHCP range too but that may cause problems if DHCP ever wanted to assign an IP that may have already been statically assigned. Of course, I also have to make sure that there are 2 valid DNS addresses either way I go too. And since I don't run my own DNS server I prefer to use OpenDNS with primary set to 208.67.222.222 and secondary at 208.67.220.220 (http://www.opendns.com/). However you can use whatever DNS server(s) you like. Just remember to leave the gateway (192.168.1.1) and netmask (255.255.255.0) alone if you keep it a class C LAN. I only mention this since you may want to do the same.

But if you're using a class B LAN then you probably would want to change your netmask to 255.255.0.0 and your Gateway would then probably be 10.0.1.1. Of course, your DNS would be whatever you like or you could just leave it alone and let your ISP provide DNS services. But as always, you may have to fiddle with ports and firewalls for the really odd ball stuff like VPN or VoIP or whatever. You may have to do it with email services or even HTML too (ports 25, 110 and 80). So don't forget about the ports and firewalls! (...and antivirus.)

share|improve this answer
add comment

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.