# No Internet with Router

## crazyweber

I am currently installing gentoo onto my new desktop and need to 

```
emerge sync
```

the only problem is that i cannot emerge it.  It gives me a resolution error.  I think this is do to the fact that I am running from a router.  I have pinged my router, dns address from my internet provider, and I have also pinged www.yahoo.com.  All have been a success.  I can't seem to figure out what the problem is.  If anyone could give me some help that would be great.  Also my motherboard is a nforce2 board and i have been reading that the 2.6 kernel now supports the board so later on will i still have to emerge each individual kernel for the nforce audio and ethernet?

Thanks,

       CrazyweberLast edited by crazyweber on Tue Jun 01, 2004 3:58 pm; edited 1 time in total

----------

## adastra

Make sure your /etc/resolv.conf reflects the proper servers.  These should be attained from the router at init when using DHCP but if you forgot to copy the resolv.conf over before chrooting in the installation directions you can have problems.  Just my first thoughts . . .

Oh yea, go KU!!

----------

## Gruguuru

It didn't work for me either when I installed, so I used emerge-webrsync. After the install, emerge sync works just fine.

----------

## crazyweber

okay i just reinstalled gentoo this time i installed it on my router.   I wrote the information from /etc/resolv.conf when booting from the bootCD.  After iI rebooted my computer I no longer have internet.  My setting are the same as what the bootCD was.  I recieve this error.

```
connect: Network is unreachable
```

Anyone have any ideas for me?

----------

## adastra

Be certain the net.eth0 script is started with

```
/etc/init.d/net.eth0 start
```

It will tell you if it is already started or will start it otherwise.  

And make sure the correct settings for DHCP for iface_eth0 are set in the /etc/conf.d/net config file.

----------

## crazyweber

yes everything is correct and eth0 has been started.  When I try to ping my router I recieve a "Destination Host Unreachable" message.  When i try to ping my DNS address from SBC Global I recieve

```
connect:  Network is unreachable
```

What else can i do?  Any suggestions?

----------

## grepcomputers

 *Quote:*   

> okay i just reinstalled gentoo this time i installed it on my router

 

So your router is a full-fledged computer, too? Does it currently get network access (properly)?

(the problem you had in the first post, I agree, if you get it again, try webrsync)

1) can you ping yourself? (ie, 127.0.0.1, and/or localhost)

2) do you have a firewall running on your desktop box?

3) if you hardcode all the appropriate values in, then does it work, or do you still get no network?

Seeing the contents, or at least, the relevant contents, of you /etc/conf.d/net file might be helpful.

cheers!

----------

## crazyweber

sorry i must have mistaken you.  My router is a wireless router from Belkin.  

my /etc/conf.d/net

```

iface_eth0="192.168.2.98 broadcast 192.168.0.255 netmask 255.255.255.0"

```

these values are what i got from my router homepage and everything else is commented out.

I can ping 127.0.0.1 and i can ping 192.168.2.98 but i cannot ping my router

whose ip is 192.168.2.1

my /etc/resolv.conf

```

domain homenetwork

nameserver 192.168.2.1

search Belkin

```

all values for /etc/resolv.conf and /etc/conf.d/net where copied from the bootCD

I also recieve the same result when i use 

```
iface_eth0="dhcp"
```

in /etc/conf.d/net

if you need anything else just let me know

----------

## adastra

That "search" entry in your resolv.conf should be the domain name server of your ISP.  I think you mentioned you have SBC Global so that should be something like

```
search sbcglobal.net
```

Are you sure your router is set up properly?  Perhaps you have told it not to reply to ping requests and that is why you can't ping it.  If you have DHCP set up correctly on the router than the resolv.conf should automagically fill with the proper information.  I know "search Belkin" isn't going to allow you to resolve any host names.

----------

## grepcomputers

 *Quote:*   

> 
> 
> I also recieve the same result when i use
> 
> ```
> ...

 

So your computer can "communicate" with the router, at least via DHCP (ie, it can pull data off the router with a DHCP request).

However...in your /etc/conf.d/net

you have the IP address set to .2.98

and broadcast set to .0.255

Shouldn't the broadcast be set to .2.255, to match the IP address? Otherwise you are trying to broadcast over the 0 subnet when you are on the 2 subnet. DHCP would probably still work in this case, IIRC.

I agree with adastra, your search field is not supposed to be Belkin. At my uni, it was the name of the uni domain (ie, "bucknell.edu")

cheers...Last edited by grepcomputers on Wed Jun 02, 2004 5:44 pm; edited 1 time in total

----------

## crazyweber

okay i appreciate your guy's help, but i am getting a little confused so i am going to type everything out for you:

i did some research and i have figured out that search is

```
search gateway.2wire.net
```

my router ip: 192.168.2.1

my computer with gentoo ip: 192.168.2.88

my second computer ip: 192.168.2.48

so in my /etc/conf.d/net

```
iface_eth0="192.168.2.88 broadcast 192.168.2.255 netmaks 255.255.255.0"
```

and everything else commented.  I don't need any gateways, right?

in my /etc/resolv.conf

```

domain homenetwork

nameserver 192.168.2.1

search gateway.2wire.net

```

with these configuration my results are as follows:

ping 192.168.2.88 -> success

ping 127.0.0.1 -> success

ping 192.168.2.1 -> error: "Destination Host Unreachable"

if /etc/conf.d/net:

```
 iface_eth0="dhcp"
```

my results are:

ping 192.168.2.88 -> success

ping 127.0.0.1 -> success

ping 192.168.2.1 -> error: "Destination Host Unreachable"

----------

## r.j.hall

you need to have your default gateway set to 192.168.2.1 on your internal machines (the internal interface of your gateway / router)  THe router will have its gateway set by your ISP to whatever that should be by the ISP's DHCP

You should still be able to ping the 192.168.2.1 IP from any of the machines on the 192.168.2.* network.   Does your router have any firewalling that might stop it?

How did you configure the routers internal IP to 192.168.2.1?   It is usual that the default internal IP on these sort of devices is 192.168.0.1,    if you set your gentoo box to an address on the 192.168.0.* network will it ping the router on the address 192.168.0.1?

----------

## grepcomputers

 *Quote:*   

> my second computer ip: 192.168.2.48 

 

So you have a second computer on this network? Can *it* access the internet?

Can you ping the second computer from your gentoo box? Can you ping the router and the gentoo box from your second computer?

If the second computer connects to the internet correctly, then what are its settings?

And I second r.j.hall's questions/comments.

cheers...

----------

## adastra

Gateway is very important and has it's own little area down at the bottom of /etc/conf.d/net so I would definately put it in.  It will be the IP of your router.  

I notice you have "netmaks" misspelled in the iface_eth0 line, might be a problem.

You might try it without the domainname line in resolv.conf.  My laptop works fine without it on all the networks I put it on but, then again, I always use DHCP.  

Can you ping the other computer:  192.168.2.48?

Can you ping the outside world: www.gentoo.org (203.112.31.164 if your name resolution is working)?

Triple and quadruple check that your router is even supposed to be responding to ping requests.  Replying to pings is sometimes considered a security no-no so it is disabled.  

Here is my info for my laptop (which I sometimes put in a docking station, that is why there are two network cards) running DHCP:

/etc/conf.d/net:

```
# /etc/conf.d/net:

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $

# Global config file for net.* rc-scripts

# This is basically the ifconfig argument without the ifconfig $iface

#

#iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"

#iface_eth1="207.170.82.202 broadcast 207.0.255.255 netmask 255.255.0.0"

# For DHCP set iface_eth? to "dhcp"

# For passing options to dhcpcd use dhcpcd_eth?

#

iface_eth0="dhcp"

dhcpcd_eth0="-t 3"

iface_eth1="dhcp"

dhcpcd_eth1="-t 3"

# For adding aliases to a interface

#

#alias_eth0="192.168.0.3 192.168.0.4"

# NB:  The next is only used for aliases.

#

# To add a custom netmask/broadcast address to created aliases,

# uncomment and change accordingly.  Leave commented to assign

# defaults for that interface.

#

#broadcast_eth0="192.168.0.255 192.168.0.255"

#netmask_eth0="255.255.255.0 255.255.255.0"

# For setting the default gateway

#

#gateway="eth0/192.168.0.1"

```

I don't use gateway because I use DHCP.  My /etc/resolv.conf is automagically generated when whatever server I am on gives me an IP.  The "-t 3" settings are for setting the timeouts so I don't have to wait too long if there is no DHCP server around to give me an IP.  I would strongly encourage you to use DHCP if at all possible.

----------

## crazyweber

okay.... here is what i got so far

my second computer 192.168.2.48 runs Windows XP using dhcp. I do not have to manual configure this computer for the internet.  It has no problem pinging the router (192.168.2.1) or accessing the internet.  The router ip is a default set by Belkin, I can change it if i want to, but I will leave it as is for now.  

I ran the bootCD agaiin this time with a direct connection to the internet with no router.  The output of the /etc/resolv.conf:

```
 

nameserver 172.16.0.1

search gateway.2wire.net

```

The output of the /etc/conf.d/net:

```

iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"

```

then I ran the bootCD with the router in place.

The output of the /etc/resolv.conf:

```

nameserver 192.168.2.1

search Belkin (this is the name of my router for now)

```

The output of the /etc/conf.d/net:

```

iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"

```

i have tried both of these setting with thier corresponding connection and niether of them work.  Is there something else that could be possibly wrong since I can't connect to the internet w/o the router.  Also I have used dhcp w/o the router and still unable to connect to the internet

adastra:  whenever i comment out the domainname after a reboot gentoo adds that line back in anyways.  Could this be my problem, the domain name?

Also when i run Windows on this computer since it is dual boot i can get on the internet fine.

Thanks for all your help

          Crazyweber

----------

## grepcomputers

Can you give us the output of "ipconfig /all" from the WinXP box? (While it is connected to the network and functioning properly). In fact, the output of "ipconfig /all" from the WinXP partition on your gentoo box might help, too.

I don't think the domain is going to hurt you...from "man resolv.conf"

```

       domain Local  domain  name.   Most queries for names within this domain

              can use short names relative to the local domain.  If no  domain

              entry  is  present, the domain is determined from the local host

              name returned by gethostname(); the domain part is taken  to  be

              everything  after the first `.'.  Finally, if the host name does

              not contain a domain part, the root domain is assumed.

```

So when I was at Bucknell, my domain was set to bucknell.edu, which meant I could type in "webmail" and it would automatically affix ".bucknell.edu" to it. It doesn't seem to do much. I don't have one right now, but even when it was still set to bucknell.edu, my dial-up (NOT through Bucknell) still worked fine.

I would assume the router is assigning correct settings via DHCP if both the XP installs can use it to successfully connect to the internet. The question is, what is going on with gentoo.

The output of "ifconfig" and "netstat -r" from the various states/cases might help (assuming you have netstat installed, I know you can't install it if you don't, what with no network...)

I'll give this some more thought, but I have to go right now...

cheers!

----------

## crazyweber

ipconfig /all for my second computer:

```

Windows IP Configuration

       Host Name . . . . . . . . . . . . . : CRAZYWEBER2

       Primary Dns Suffix . . . . . . . . : 

       Node Type . . . . . . . . . . . . . : Hybrid

       IP Routing Enabled . . . . . . . : No

       WINS Proxy Enabled . . . . . . : No

       

Ethernet adapter Network Bridge:

          

       Connection-specific DNS Suffix . :Belkin

       Description . . . . . . . . . . . . . .  : MAC Bridge Miniport

       Physical Address. . . . . . . . . . . : B2-2C-D3-D8-06-54

       Dhcp Enabled. .  . . . . . . . . . .  :   Yes

       Autoconfiguration Enabled. . . . . : Yes

       IP Address. . . . . . . . . . . . . . . : 192.168.2.48

       Subnet Mask . . . . . . . . . . . . : 255.255.255.0

       Default Gateway. . . . . . . . . . : 192.168.2.1

       DHCP Server . . . . . . . . . . . . : 192.168.2.1

       DNS Servers . . . . . . . . .. . . . : 192.168.2.1

       Lease Obtained . . . . . . . . . . : Thursday, June 03, 2004 12:31:00 AM

       Lease Expires . . . . . . . . . . : Monday, January 18, 2038 10:14:07 PM

```

ipconfig /all for my box with gentoo on it:

```

Windows IP Configuration

       Host Name . . . . . . . . . . . . . : crazyweber1

       Primary Dns Suffix . . . . . . . . : 

       Node Type . . . . . . . . . . . . . : Unknown

       IP Routing Enabled . . . . . . . : No

       WINS Proxy Enabled . . . . . . : No

       

Ethernet adapter Network Bridge:

          

       Connection-specific DNS Suffix . :Belkin

       Description . . . . . . . . . . . . . .  : MAC Bridge Miniport

       Physical Address. . . . . . . . . . . : 72-18-CB-08-EA-C4

       Dhcp Enabled. .  . . . . . . . . . .  :   Yes

       Autoconfiguration Enabled. . . . . : Yes

       IP Address. . . . . . . . . . . . . . . : 192.168.2.88

       Subnet Mask . . . . . . . . . . . . : 255.255.255.0

       Default Gateway. . . . . . . . . . : 192.168.2.1

       DHCP Server . . . . . . . . . . . . : 192.168.2.1

       DNS Servers . . . . . . . . .. . . . : 192.168.2.1

       Lease Obtained . . . . . . . . . . : Friday, June 04, 2004 12:04:03 AM

       Lease Expires . . . . . . . . . . : Monday, January 18, 2038 10:14:07 PM

```

with resolv.conf as:

```

domain homenetwork

nameserver 192.168.2.1

serach Belkin

```

and conf.d/net as:

```

iface_eth0="192.168.2.88 broadcast 192.168.0.255 netmask 255.255.255.0"

gateway="eth0/192.168.2.1"

```

my netstat -r is:

```

Kernel IP routing t able

Destination     Gateway      Genmask          Flags  MSS Window  irtt Iface

192.168.2.0     *             255.255.255.0   U      0 0        0 eth0 

loopback       localhost      255.0.0.0     UG      0 0        0 lo

default       192.168.2.1    0.0.0.0        UG      0 0         0 eth0

```

with same resolv.conf but conf.d/net as:

```

iface_eth0="dhcp"   

```

my netstat -r is:

```

Kernel IP routing t able

Destination     Gateway      Genmask          Flags  MSS Window  irtt Iface

192.168.2.0     *             255.255.255.0   U      0 0        0 eth0 

loopback       localhost      255.0.0.0     UG      0 0        0 lo

default       192.168.2.1    0.0.0.0        UG      0 0         0 eth0

```

those two setting seem to be the most relevant because the resolv.conf seems to be correct with my ipconfg /all output.  Also to let you know my mobo is a Gigabyte NVidia 2 board.  I don't know if that would change anything because I am running the 2.6.5 gentoo-dev-sources kernel and all nvidia 2 modules have been added into the kernel.  I figure i would let you know since in the install it has you emerge nforce-net, but it wouldn't let me emerge it.  if you need anything else just let me know.  Thanks for your help.

-Crazyweber

----------

## grepcomputers

I still maintain that, if the IP address is 192.168.2.whatever and the netmask is 255.255.255.0, then the broadcast should be 192.168.2.255. You match them up.

I've been a little busy lately so I have not had time to think about this, and I am still a little busy, so I can't write much now, sorry.

cheers!

----------

## crazyweber

hey grep....

I finally got internet working.  I should have mentioned a long time ago that I have to ethernet connections on this board.  Anyways i just tried to plug it into my other connection and there it was.  Internet in linux.  Funny stuff computers will do to you.  Anyways  Thanks for all the help everybody.

----------

## grepcomputers

I'm glad you got your internet working. And now you can enjoy broadband internet with gentoo linux.  :Very Happy: 

cheers!

----------

