LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-02-2011, 12:54 PM   #1
mbvpixies78
Member
 
Registered: Nov 2007
Location: Vietnam
Distribution: CentOS
Posts: 181
Blog Entries: 3

Rep: Reputation: 16
Ubuntu Server Can't Access Internet


I'm setting up an old box as a dedicated file-sharing server on the LAN as well as an internet web server for my personal web site but I have no network connection. My computer is connected to a router which is connected to my DSL modem. The router has the Ubuntu box's MAC address as well as a Win7 box, which connects to the internet fine.

Here is what I've tried:

1. Check routing table
Code:
$route
Destination Gateway Genmask    Flags Metric Gen Use iface
127.0.0.0       *   255.0.0.0    U      0    0   0   lo
2. Try to add a default gateway to the internet on eth2, this happens:
Code:
$sudo route add default gw 192.168.1.254 dev eth2
SIOCADDRT:  No such process
3. I edited resolv.conf, which was empty, adding:
nameserver 208.67.222.222

4. I edited /etc/network/interfaces as follows:
Code:
# The primary network interface
auto eth2
iface eth2 inet dhcp
gateway 192.168.1.254
Then I type the following:
Code:
$sudo /etc/init.d/networking restart
Listening on LPF eth2/<MAC address>
Sending on LPF eth2/<MAC address>
Sending on socket/fallback
DHCPDISCOVER on eth2 to 255.255.255.255 port 67 interval 6
DHCPDISCOVER on eth2 to 255.255.255.255 port 67 interval 15
...  and it keeps doing this endlessly because it's not finding the DHCP server, presumably...?
This didn't solve the problem and so I attempted another configuration:
Code:
auto eth2
iface eth2 inet static
address x.x.x.x
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.1.254 (or, alternately, the address of my router, 192.168.0.1)
Still, not internet connection and no ability to apt-get anything (says packages not found)

So, this didn't work either. Can anyone help me with suggestions? I've been reading lots of articles and books so please don't tell me to read something else. What I've tried should work, especially the route command. Now why won't it work?

Thanks,

Danny3

Last edited by mbvpixies78; 01-02-2011 at 01:03 PM.
 
Old 01-02-2011, 12:57 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Why it's your ip address secret? Private ip addresses are not something that needs to be protected. In the interface config the broadcast address is on a different subnet to the default gateway. Which subnet is right?
 
Old 01-02-2011, 01:06 PM   #3
mbvpixies78
Member
 
Registered: Nov 2007
Location: Vietnam
Distribution: CentOS
Posts: 181

Original Poster
Blog Entries: 3

Rep: Reputation: 16
Quote:
Originally Posted by acid_kewpie View Post
Why it's your ip address secret? Private ip addresses are not something that needs to be protected. In the interface config the broadcast address is on a different subnet to the default gateway. Which subnet is right?
My bad-- my local addy is 192.168.0.101 (the win comp ends in 100 instead)

If my router is on 192.168.0.1, is the 0 subnet the correct one? As in, gateway should be 192.168.0.254 and broadcast should be 192.168.0.255?


Upon trying this in interfaces, I still get the endless DHCPDISCOVER

Last edited by mbvpixies78; 01-02-2011 at 01:08 PM.
 
Old 01-02-2011, 01:13 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well you really need to know for yourself what your default gateway is. It could be any IP in that subnet, but probably .1 or .254. As above, you've been using .1.254 throughout, which is clearly, at best, inconsistent with this subnet.
 
Old 01-02-2011, 01:16 PM   #5
mbvpixies78
Member
 
Registered: Nov 2007
Location: Vietnam
Distribution: CentOS
Posts: 181

Original Poster
Blog Entries: 3

Rep: Reputation: 16
Quote:
Originally Posted by acid_kewpie View Post
well you really need to know for yourself what your default gateway is. It could be any IP in that subnet, but probably .1 or .254. As above, you've been using .1.254 throughout, which is clearly, at best, inconsistent with this subnet.
My Router's routing table says it's 192.168.1.254. So does that mean my broadcast should be 192.168.1.255?

Also, I can't ping my router (192.168.0.1, which is correct because I can access it in Win7 through Firefox browser)

If there is still inconsistency here, how do I change it? Commands aren't working.

Last edited by mbvpixies78; 01-02-2011 at 01:22 PM.
 
Old 01-02-2011, 01:51 PM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
How can your router be 0.1 and 1.254 at the same time?? Or are you saying that your routers own default gw is that other IP??

OK, so you have another box next to it that's working, right? Well copy those details as applicable.
 
Old 01-02-2011, 02:12 PM   #7
mbvpixies78
Member
 
Registered: Nov 2007
Location: Vietnam
Distribution: CentOS
Posts: 181

Original Poster
Blog Entries: 3

Rep: Reputation: 16
Quote:
Originally Posted by acid_kewpie View Post
How can your router be 0.1 and 1.254 at the same time?? Or are you saying that your routers own default gw is that other IP??

OK, so you have another box next to it that's working, right? Well copy those details as applicable.
I understand what you're saying. It makes little sense to me either. If I point my browser to 192.168.0.1, I get my router configuration pages, where my router also seems to have the address 192.168.1.64. On there the default gateway is listed as 192.168.1.254
Code:
Login Type:  	Automatic Configuration - DHCP  	   	 
  	  	  	IP Address: 	192.168.1.64 	  	 
  	  	  	Subnet Mask: 	255.255.255.0 	  	 
  	  	  	Default Gateway: 	192.168.1.254 	  	 
  	  	  	DNS 1: 	192.168.1.254
Are you suggesting I change my router to 192.168.1.1? Whatever will work is what I want to do here because a server with no internet access is pretty useless.

The settings in Win7 box are all automatic DHCP. How do I do this with Ubuntu?
 
Old 01-02-2011, 02:22 PM   #8
mbvpixies78
Member
 
Registered: Nov 2007
Location: Vietnam
Distribution: CentOS
Posts: 181

Original Poster
Blog Entries: 3

Rep: Reputation: 16
Now it won't boot at all. I'm reinstalling Ubuntu Server and starting again from scratch. I want to learn the command line and get networking set up, then install xfce as a fall-back when stumped. Once it's reinstalled, I'll post all my config file contents.

Last edited by mbvpixies78; 01-02-2011 at 02:37 PM.
 
Old 01-02-2011, 04:41 PM   #9
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Well automatic is just dhcp, which would always be a safe default. I don't see how you got into this combustion in the first place. Just start with dhcp and worry about the rest later.

Never did get to grips with mbv btw. Loveless just always sounded like a really bad hangover to me.
 
Old 01-02-2011, 04:57 PM   #10
mbvpixies78
Member
 
Registered: Nov 2007
Location: Vietnam
Distribution: CentOS
Posts: 181

Original Poster
Blog Entries: 3

Rep: Reputation: 16
Quote:
Originally Posted by acid_kewpie View Post
Well automatic is just dhcp, which would always be a safe default. I don't see how you got into this combustion in the first place. Just start with dhcp and worry about the rest later.

Never did get to grips with mbv btw. Loveless just always sounded like a really bad hangover to me.
Ok, so if I set up /etc/network/interfaces like this:
Code:
auto eth0
iface eth0 inet dhcp
This by itself should in theory work?

lol re:mbv-- yeah, but sometimes life feels like a really bad hangover so maybe that's why I like the familiarity of it.
 
Old 01-02-2011, 05:08 PM   #11
mbvpixies78
Member
 
Registered: Nov 2007
Location: Vietnam
Distribution: CentOS
Posts: 181

Original Poster
Blog Entries: 3

Rep: Reputation: 16
When I type /etc/init.d/networking restart it finishes with no DHCPOFFERS. As I said, I can't ping my router, so that's no surprise.

How can I connect to my router?
 
Old 01-02-2011, 05:46 PM   #12
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Could you post the full results of "ifconfig" & "route" on each interface on the Ubuntu server. Also post the results of "ipconfig" on the Win7 box.
Having an eth2 implies you also have eth1 & eth0.

If you have more than one interface, please indicate in more detail how your network is wired. Are you trying to set up a DMZ? Do you have more than one router? Are you connecting both the router and the server to the modem directly?

The results of "ipconfig" on the Win7 box will help in determining what your subnet is; e.g. "192.168.0.0/24". The gateway setting should be the same on both if you are on the same lan.

Nail down what your real internet IP address is. Does the modem have an embedded router? If not and you are behind NAT at the ISP, then you won't be able to host a web site because you don't have an internet IP address.

Lastly disable IPv6 support. DHCP6 could be the cause of dhcp failures. I did this do fix a problem with a Vista laptop not joining a wireless network.

Last edited by jschiwal; 01-02-2011 at 05:50 PM.
 
Old 01-02-2011, 06:59 PM   #13
mbvpixies78
Member
 
Registered: Nov 2007
Location: Vietnam
Distribution: CentOS
Posts: 181

Original Poster
Blog Entries: 3

Rep: Reputation: 16
Quote:
Originally Posted by jschiwal View Post
Could you post the full results of "ifconfig" & "route" on each interface on the Ubuntu server. Also post the results of "ipconfig" on the Win7 box.
Having an eth2 implies you also have eth1 & eth0.

If you have more than one interface, please indicate in more detail how your network is wired. Are you trying to set up a DMZ? Do you have more than one router? Are you connecting both the router and the server to the modem directly?

The results of "ipconfig" on the Win7 box will help in determining what your subnet is; e.g. "192.168.0.0/24". The gateway setting should be the same on both if you are on the same lan.

Nail down what your real internet IP address is. Does the modem have an embedded router? If not and you are behind NAT at the ISP, then you won't be able to host a web site because you don't have an internet IP address.

Lastly disable IPv6 support. DHCP6 could be the cause of dhcp failures. I did this do fix a problem with a Vista laptop not joining a wireless network.

Js,

Basically, I have 2 computers both connected to 1 Linksys router which is then connected to a Motorolla AT&T DSL modem. I'm using eth0 on Ubuntu box and not using eth1 or eth2 at all. So no, the server isn't connected directly to internet, but router is and server connects to router, just as with Win box.

The AT&T Motorolla DSL modem doesn't appear to have routing as there are no options for such on its IP setup pages. There are a lot of settings there though, just nothing route-related that I was able to find.

Also of important note: I have a DDNS subscription with TZO in order to host my web site. My router has built-in support for TZO and it's set up and was working fine on Win7 before it crashed and the web pages disappeared.

Where should I disable IPv6 support? Modem, router, Ubuntu, Win7, all of the above?

I'm having to write all this down and then type it here, so if I mis(spell) anything, just ask. I'm using a KVM switch between a Win7 and the Ubuntu server. That said, ask and ye shall receive, transcribed:

ifconfig:
Code:
eth0     Link encap ethernet
         HW ADDR......
         Up broadcast running multicast MTU:1500
         metric 1
         Rx all 0
         Tx all 0
         txqueuelen:  1000
         Interrupt 17

lo       Link encap:  local loopback
         inetaddr:  127.0.0.1
         mask 255.255.255.255
         Up Loopback running
         MTU:  16436  Metric 1
         Rx 184  Tx 184
         txque: 0
         Rx bytes == Tx bytes
When I enter route I get a completely empty routing table-- it just shows column labels and nothing beneath.

Win7 ipconfig (yay! I can copy and paste this one! Screw stenography)
Code:
C:\Windows\system32>ipconfig

Windows IP Configuration


Ethernet adapter Local Area Connection:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::5006:54b8:c010:ae3d%13
   IPv4 Address. . . . . . . . . . . : 192.168.0.100
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.0.1

Ethernet adapter VirtualBox Host-Only Network:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::b046:f6bc:74d1:e23f%16
   IPv4 Address. . . . . . . . . . . : 192.168.56.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :

Ethernet adapter VMware Network Adapter VMnet1:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::b47b:3124:ebb7:6c57%19
   IPv4 Address. . . . . . . . . . . : 192.168.96.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :

Ethernet adapter VMware Network Adapter VMnet8:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::38b2:62f5:9146:c352%21
   IPv4 Address. . . . . . . . . . . : 192.168.149.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :

Tunnel adapter isatap.{5863BDB0-D2F0-4D0E-A5CA-6A8BB5FCC0EF}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter Local Area Connection* 9:

   Connection-specific DNS Suffix  . :
   IPv6 Address. . . . . . . . . . . : 2001:0:4137:9e76:2cda:465:3f57:ff9b
   Link-local IPv6 Address . . . . . : fe80::2cda:465:3f57:ff9b%12
   Default Gateway . . . . . . . . . : ::

Tunnel adapter isatap.{6FFD2BE1-82B4-4C50-ADC9-069F621A32F1}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter isatap.{47E79A7F-B5E4-46CF-8910-60CB627C524F}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter isatap.{FE535BED-514C-4E3E-A5E0-1BEC0BB5DF14}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

C:\Windows\system32>
Please note that none of my VMs are up and running.
 
Old 01-04-2011, 01:13 PM   #14
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Disable IPv6 on the Ubuntu computer. On Ubuntu you are using the 192.168.1.0/24 network, while on Windows you are using 192.168.0.0/24. I looks like you manually configured Ubuntu for the wrong network address.

The address you gave for your internet address isn't one that someone on the internet can reach. Go to a site like "www.myip.dk" to find out what your real internet address is. Either the modem has a built in router translating your IP address, or your ISP has you behind NAT and you may be sharing this IP address with other users. If you can open port 80 on your router and someone on the internet can reach it, the former is true.

Not all routers function as a DNS relay. You may need to enter your ISPs name server addresses in that case.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
No internet access after installing GUI on ubuntu server rough60 Ubuntu 10 12-27-2010 05:22 AM
[SOLVED] PPPOE server access the internet clients fail to access the internet simbini Linux - Newbie 3 08-31-2010 12:37 AM
Remote, Internet and LAN access to Ubuntu Server ehcah Linux - Server 12 07-21-2010 09:21 PM
Ubuntu server cannot access internet but LAN machines can. librano Linux - Server 2 05-13-2007 01:17 PM
internet server that use a prepaid account to access the internet elgieb1 Linux - General 0 02-19-2007 11:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration