[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: In network bonding second nic (eth1) is not pingable while first one (eth0) is always pingable"



On 8/22/20, Dan Ritter <dsr@randomstring.org> wrote:
> Lee wrote:
>>
>> Or you can just configure the wired ethernet connection to have a
>> lower (better) routing metric than the wireless connection.  That way
>> the machine always uses the wired connection if it's up and uses the
>> wireless connection when the wired connection is down.
>>
>> There's probably a nice and easy way to do that by changing
>> /etc/network/something .. I never figured out how to do it that way &
>> used the 'Advanced Network Configuration' gui tool to set the wired
>> connection 'Connect automatically with priority' to -999
>>
>> With the ethernet cable connected to the laptop, 'ip route' shows wls1
>> with a metric of 600 and enp1s0 with a metric of 100.
>> With the ethernet cable disconnected the only thing that 'ip route'
>> shows is wls1.
>> Yay! automatic failover + automatic selection of the faster interface
>> when it's up :-)
>
> This will generally work, but it does have a drawback: you have
> two different IPs, so when a change happens, all your existing
> connections will drop and new inbound connections will only work
> on the NIC that's up.

True.  But it's better than manually switching things around.

hrmm... I just went back to the original post; I missed this bit the
first time around:
> In this setup i'm using a D-Link 8 port switch to connect eth0 using
> ethernet cable and eth1 is connected on wireless adapter of my laptop.

eth0 and eth1 are probably on two different networks (same as my wls1
& enp1s0 are on two different networks); that'd be my guess for why
failover doesn't work.  Both NICs need to be on the same network for
bonding to work.

Lee


Reply to: