1

I have 2 ISP connetions, first ISP use mac binding, second use PPPoE

/etc/network/interfaces

auto lo
auto lan
allow-hotplug gembird-white
allow-hotplug gembird-black

iface lo inet loopback

iface lan inet static
  address 192.168.1.1/24

iface gembird-white inet dhcp
  hwaddress ether 64:70:02:XX:XX:XX

iface gembird-black inet dhcp

auto dsl-provider
iface dsl-provider inet ppp
pre-up /bin/ip link set gembird-black up
provider dsl-provider

Afet boot I am manualy runs my balance.sh:

#!/bin/bash

IF1="gembird-white"   # WAN interface 1
IF2="ppp0"            # WAN interface 2

GW1="188.230.111.1"
GW2="62.122.200.239"
W1=1
W2=2

route del default
ip route add default scope global nexthop via $GW1 dev $IF1 weight $W1 nexthop dev $IF2 weight $W2

The problem is that first provider give me dynamic IP and dynamic GW, that can change.

I don't know how to get gateway from my first ISP, because after boot ppp is already up and

route -n

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 ppp0
188.230.111.0   0.0.0.0         255.255.255.0   U     0      0        0 gembird-white
...

Help me please with it

And where is right place to run my balance.sh???

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.