# subnet ping



## dcastellacci (Feb 20, 2022)

Hello,

the pc (A) ip 192.168.8.1 default gw ip 192.168.1.1 (router) --> internet

the pc (A) ping also pc (B) ip 192.168.8.2

the pc (A) on the other hand cannot make a ping from the pc (A) towards the ip 192.168.10.1 of the pc (B)

the pc (B) default gw ip 192.168.8.1

How can pc (A) ping to reach pc (B)'s ip 192.168.10.1 ?


//French 
le pc (A) ip 192.168.8.1 default gw ip 192.168.1.1 (router) --> internet

le pc (A) ping aussi le pc (B) ip 192.168.8.2 

le pc (A) par contre ne peut pas faire un ping depuis le pc (A) vers le ip 192.168.10.1 du pc (B)

le pc (B) default gw ip 192.168.8.1

Comment faire pour que le pc (A) puisse faire un ping pour atteindre l'ip 192.168.10.1 du pc (B) ?

Thank You
Didier


----------



## Geezer (Feb 20, 2022)

Alias!


----------



## zirias@ (Feb 20, 2022)

This looks extremely confus[ed|ing].

Assuming the usage of /24 subnets, why are the default gateways outside these subnets?
What's the router doing, does it actually route between these subnets?
etc. pp. ...


----------



## dcastellacci (Feb 20, 2022)

here is a diagram
//
internet----192.168.8.1 (A)-----o------(B) 192.168.8.2-------o------(B) 192.168.10.1

the pc (A) ip 192.168.8.1 default gw ip 192.168.1.1 (router) --> internet

the pc (A) ping also pc (B) ip 192.168.8.2

the pc (A) on the other hand cannot make a ping from the pc (A) towards the ip 192.168.10.1 of the pc (B)

the pc (B) default gw ip 192.168.8.1

How can pc (A) ping to reach pc (B)'s ip 192.168.10.1 ?

Thank You
Didier


----------



## zirias@ (Feb 20, 2022)

Do you know how IP subnets and routing work at all?  You didn't mention any netmask, so I assume you're using /24 subnets...

Having a default gateway outside your own subnet is certainly possible with adding some host routes, but it's "advanced stuff".

Start with a simple configuration where the router has an address in each subnet it routes.


----------



## chrbr (Feb 20, 2022)

Bonjour Didier,
I am not sure about the diagram. Has the PC (B) two network interfaces? I guess yes, but I am not sure.


----------



## dcastellacci (Feb 20, 2022)

internet----192.168.8.1/24-----PC (A) 
                                               PC (B)------192.168.8.2/24-------o------192.168.10.1/24


Yes the PC (B) has 2 network interfaces 1 interface 192.168.8.2/24
and the other 2 interface 192.168.10.1/24


Thank You
Didier


----------



## chrbr (Feb 20, 2022)

May be you like to have a look at https://docs.freebsd.org/en/books/handbook/advanced-networking/. This chapter starts with routing stuff. Especially "32.2.2. Configuring a Router with Static Routes" should be useful.


----------



## covacat (Feb 20, 2022)

on A
static_routes="b"
route_b="-net 192.168.10.0/24 192.168.8.2"


----------



## dcastellacci (Feb 20, 2022)

Thank you very much covacat it works great I'm very happy problem solved


----------

