0

I have two networks with each gateway on a separate network device on a single computer. One is a static ip network on the ethernet device, the other is a wifi connection to a router that is assigning dhcp with internet access. I have no control over the address range of the wifi router, but it will be serving dhcp.

An application that relies on the first, static network is accessing the network based on the OS's understanding of the default gateway.

What is the best way to connect the two networks or somehow have only one gateway that allows access to the two networks. For example, if the application needs to talk to the internet and the static network.

Matty H
  • 103
  • 2
  • 1
    What...? either my English is bad or your question is poor...This seems to be a routing issue, nevermind if the gateway is static or DHCP. Of course DHCP is able to change address of the gateway, here is the SPOF. The short answer to your question in title would be "yes, you can. It will work until DHCP changes Gateway IP address". – krisFR Jul 20 '14 at 23:23
  • Hey KrisFR, I am open to editing the question, did you mean to put a link on the SPOF? I didn't quite get the way that a system uses the gateway, but I think Glen nailed it with one of his comments – Matty H Jul 23 '14 at 03:12

2 Answers2

0

Look at "route add" in a command line. Add the wifi network for all traffic and use the interface value for your wifi. Add the static network only through your wired lan. This is hard coding your computer to act as a dumb router.

Glen
  • 211
  • 1
  • 3
  • 1
    Thanks. I was looking at route add and it seemed like that command wanted an ip address, not just an interface name. I am under the impression that I cannot add a route to a network when the gateway is a dynamically allocated ip without first finding out the ip. I want to configure it without knowing first if possible. – Matty H Jul 21 '14 at 05:08
  • If you don't assign a gateway to network going to the static network, then all traffic going to unknown networks will be sent to the wifi network, as it does have a gateway, even though you don't know it before hand. – Glen Jul 21 '14 at 08:54
  • Glen, that is totally what I needed to know, and thank you for going into detail to help me understand it. Maybe you can modify the answer you originally gave to integrate that last bit, and I can edit the question if needed to make this a good historical question if possible. – Matty H Jul 23 '14 at 03:09
0

You will need to add two routes. One on the Wifi router telling it about the network behind the router. The second route goes on the router to tell it about the network behind the Wifi router.

George
  • 73
  • 3