Route add gw: how to

16,234

Solution 1

I don't think you can add a route, because your network has no idea about reaching the 192.168.1.* network. You need to setup a router on PC B, which takes routes the packet from 10.0.. network to 192.168.1.* network. And then you have to keep PC B as your default gateway, which should solve your problem.

Solution 2

You would have to update the routing table on 10.0.1. network's router, so that it will route packets to 192.168.1.1 via 10.0.3.x router.

You also need to make reverse routes from 192.168.1.1 to 10.0.1. network, unless the default router for that network already knows the proper route.

Share:
16,234

Related videos on Youtube

Luca Davanzo
Author by

Luca Davanzo

I'm a software developer and I've worked mainly on interactive multimedia applications. Actually I'm an iOS developer. SOreadytohelp

Updated on September 18, 2022

Comments

  • Luca Davanzo
    Luca Davanzo almost 2 years

    I'm in a network with IP 10.0.1.X (pc A).

    There's another sub-network: 10.0.3.0

    I can ping pc B connected to this network:

    ping 10.0.3.X ---> OK
    

    Now, B is connected also in wifi to a network 192.168.1.1 (C)

    I want to connect to this one directly from my pc:

    sudo route add 192.168.1.1 gw 10.0.3.X
    

    but I have this response: SIOCADDRT: No such process

    How can I realize this forwarding?

    • EightBitTony
      EightBitTony about 10 years
      Quite apart from the question of 'does 10.0.3.x actually allow itself to be a router', can you including ifconfig output and route output in your query.