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.

I have installed ubuntu server 11.04 edition (with LAMP, mail server, and SSH server) and I try to connect to the internet. When I plug the cable from my ISP with the configuration provided below to a router and then back to my server the connection works fine, but when I try to put the cable directly to my server without the router, with the same information configuration the internet connection doesn't work any more.

resolv.conf
nameserver 81.180.166.1

eth0 Link encap:Ethernet HWaddr 00:12:79:a5:0b:39
inet addr:81.180.166.151 Bcast:81.180.167.255 Mask:255.255.254.0
inet6 addr: fe80::212:79ff:fea5:b39/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5697 errors:0 dropped:1854 overruns:0 frame:0
TX packets 34 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:467192 TX bytes:2594
interrupt:25

In /etc/network/interfaces:

auto eth0
iface eth0 inet static
ip:81.180.166.151 
subnetmask:255.255.254.0 
gateway:81.180.166.1 
dns: 193.230.240.16 
mac:00 0E A6 41 C6 38.
share|improve this question
    
Could you also paste the output of 'ip route show'? –  ajmitch Oct 3 '11 at 7:29
1  
81.180.166.0/23 dev eth0 proto kernel scope link src 81.180.166.151 default via 81.180.166.1 dev eth0 metric 100 81.180.166.0/23 dev eth0 proto kernel scope link src 81.180.166.151 default via 81.180.166.1 dev eth0 metric 100 –  saveandload.com Oct 3 '11 at 7:41
    
How do you connect with your static connection to the internet? Do you have a router in the middle, modem, anything? I dont belive your ISP installed a cable straight to your home to share their private network with you ;) Tell me more about your network, where is what connected, how many NICs you have output your ifconfig -a with the dynamic net and the static one connected. –  Bruno Pereira Oct 3 '11 at 7:43
1  
Can you write down what your ISP said it would be your IP address, gateway IP and DNS servers? Do you have only 1 NIC? (So 1 card, 2 different connections?) –  Bruno Pereira Oct 3 '11 at 8:41

1 Answer 1

up vote 4 down vote accepted

The line stating the IP address for the DNS server in /etc/resolv.conf should read

nameserver 193.230.240.16

rather than being the IP address of the gateway (81.180.166.1), if that is what the ISP says the DNS server should be.

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.