-1

I'm using both WiFi + Ethernet on my computer, but the route table settings on Win 7 is different with my Linux(Ubuntu 14.04) computer.

win7 will set two default gateway for each device(wife and Ethernet), but Linux network-manager will replace my WiFi default gateway for Ethernet.

Insert Ethernet cable during WiFi connection will bring my xfreerdp disconnect due to WiFi's default gateway is gone.

I could add the default gateway for WiFi manually,but I wonder if there are some risk to do that; since network-manager should be smarter than me but it didn't do that either.

AReddy
  • 3,172
  • 5
  • 36
  • 76
Wally
  • 28
  • 2
    What do you want to have happen when you have two default routes installed? Load-balance outgoing packets through both gateways? Since they are connected to different networks, that's not likely to be useful. – Celada Mar 02 '16 at 08:06
  • if my wifi default gateway got replaced by ethernet, my previous RDP connection will disconnect since packets can't find way out. – Wally Mar 02 '16 at 09:38
  • You cannot have two default routes. The (single) default route defines the route that will be taken if no other route matches. On Windows systems the "two default routes" have different metrics so one takes precedence over the other, which is then ignored. – Chris Davies Mar 02 '16 at 10:47
  • Thankyou! roaima, you answer my question. and I'm very appreciated you about how windows twin default route works. – Wally Mar 02 '16 at 11:20
  • Do you have a need for two default gateways or is it something you are just trying to see work like it does in Windows? I will set the default gateway for the majority of traffic and the use static routes to send additional traffic via another gateway. That can be configured on rhel like systems in in the: /etc/sysconfig/network-scripts/route-eth0 –  Mar 02 '16 at 13:28

1 Answers1

0

You cannot have two default routes. The (single) default route defines the route that will be taken if no other route matches.

On Windows systems the "two default routes" have different metrics so one takes precedence over the other, which is then ignored.

Here is the output from my Windows PC with wired and wireless connections active:

Network Destination    Netmask          Gateway       Interface    Metric
            0.0.0.0    0.0.0.0    192.168.1.254     192.168.1.8        20
            0.0.0.0    0.0.0.0    192.168.1.254    192.168.1.88        25

The lower the metric value the higher the priority. (This applies to Unix/Linux based systems, too.) So the preferred interface will be 192.168.1.8, which happens to be the wired one.

Chris Davies
  • 116,213
  • 16
  • 160
  • 287
  • I do lots experiment, seems windows can keep application's packets out to specific route: I do wifi connect first, the connect RDP A, then do ethernet connect, finally connect RDP B.

    if I delete the route for ethernet, RDP B will discconect, but RDP A still keep alive, seems RDP A alway through the wifi default route no matter the metric it is.

    – Wally Mar 03 '16 at 06:56