# pinging outside the network behind two routers

## rodaz143

Hello everyone. As the topic states, I'm having some difficulty pinging outside my network. I have two routers set up. The master router, and the secondary router, which is acting as a wireless bridge. My Gentoo box is connected to the secondary router. I can ping both routers and all computers on the network, but nothing outside the local network. The main router's IP is 10.0.0.1 and the secondary router's IP is 10.0.0.254

Here is my /etc/conf.d/net:

```

config_enp1s0="10.0.0.253/24"

routes_enp1s0="default via 10.0.0.254"

dns_servers_enp1s0="10.0.0.1 8.8.8.8"

```

And the results of ip route show

```

default via 10.0.0.0/24 dev enp1s0 proto kernel scope link src 10.0.0.253

127.0.0.0/8 dev lo scope host

```

What am I doing wrong?

----------

## NeddySeagoon

rodaz143,

Welcome to Gentoo.

Test with 

```
ping google.com
```

 and 

```
ping 173.194.34.96
```

If both fail, its a routing problem.

If the ping by name fails but ping by IP works, its a DNS issue.

Any error messages you get will be useful too.

----------

## rodaz143

I'm getting this message by pinging the IP address 

```
From 10.0.0.254: icmp_seq=1 Redirect Host(New nexthop: 10.0.0.1)
```

And obviously I can't ping any domains.

UPDATE:

well that's odd. I went to eat dinner and forgot that not only was I logged into the server from my laptop via ssh, I was also pinging  (or rather, trying to ping) 8.8.8.8, Google's OpenDNS primary server. When I noticed it and stopped it, this was the output 

```
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.

64 bytes from 8.8.8.8: icmp_seq=1702 ttl=47 time=39.5 ms

^C

--- 8.8.8.8 ping statistics ---

13856 packets transmitted, 1 received, 99% packet loss, time 13855083ms

rtt min/avg/max/mdev = 39.589/39.589/39.589/0.000 ms
```

----------

## lexflex

 *rodaz143 wrote:*   

>  The master router, and the secondary router, which is acting as a wireless bridge. 
> 
> ```
> 
> config_enp1s0="10.0.0.253/24"
> ...

 

Hi,

It depends on whether your secondary 'router' is actually configured as a bridge or not.

If it is a bridge, I guess you cannot use it as  the default gateway.

Maybe try to change the default routes /gateway to the IP address of your primary router. ( 10.0.0.1) .

One other thing to make sure: If you connect your computer directly to the primary router, everything does work? ( just to make sure nothing else is going on).

Alex.

----------

## rodaz143

it's configured as a bridge according to 

http://www.dd-wrt.com/wiki/index.php/Wireless_Bridge

It still doesn't work even if I set the main router as my default gateway. I tried plugging it into the main router directly and it worked fine.

----------

## lexflex

Mmm, strange, ' ip route show' in your case doesn't show the gateway but I guess it should (if I try it gives 'default via <correct IP>' )

 *rodaz143 wrote:*   

> 
> 
> And the results of ip route show
> 
> ```
> ...

 

Can you try to set the default gateway  using something like:

```
route add default gw 10.0.0.1 enp1s0
```

and try again ip show route to see if it make any difference ? ( i.e. if it then shows the gateway you defined? ).

----------

## lexflex

One more thing, in /etc/conf.d/net:

```
config_enp1s0="10.0.0.253/24" 
```

Shouldn't that be (in order to define the IP address):

```
config_enp1s0="10.0.0.253" 
```

Or is this the way to define the netmask ?

----------

## rodaz143

never mind, I think the issue may be with my slave router and the fact that it's set as a bridge. Looking at the main router's connected devices panel, it looks like the slave router was doing weird things with the server's IP, so I'm going to try messing with the slave router's configuration

----------

## NeddySeagoon

lexflex,

Thats an alternate way to define the netmask.

Bold ways are valid syntax

----------

