Имеются 2 сетевые карты и 2 провайдера.
[fil@lair ~]$ ifconfig
enp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.100 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::bcd8:11c:aec4:eba5 prefixlen 64 scopeid 0x20<link>
ether 00:25:22:39:6a:55 txqueuelen 1000 (Ethernet)
RX packets 31444 bytes 30425932 (29.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 23875 bytes 7076099 (6.7 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp4s1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::9d03:1bd8:c3ad:83cd prefixlen 64 scopeid 0x20<link>
ether 10:bf:48:e7:94:b0 txqueuelen 1000 (Ethernet)
RX packets 550 bytes 182319 (178.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 619 bytes 80509 (78.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 47324 bytes 26307776 (25.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 47324 bytes 26307776 (25.0 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1492
inet X.X.X.X netmask 255.255.255.255 destination X.X.X.X
ppp txqueuelen 3 (Point-to-Point Protocol)
RX packets 156 bytes 69121 (67.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 87 bytes 7127 (6.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Вот таблица маршрутизации:
[fil@lair ~]$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.1 0.0.0.0 UG 203 0 0 enp1s0
X.X.X.X 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
192.168.0.0 0.0.0.0 255.255.255.0 U 203 0 0 enp1s0
[fil@lair ~]$ ping -c 1 -I ppp0 ya.ru
PING ya.ru (213.180.204.3) from X.X.X.X ppp0: 56(84) bytes of data.
64 bytes from www.yandex.ru (213.180.204.3): icmp_seq=1 ttl=56 time=16.7 ms
--- ya.ru ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 16.792/16.792/16.792/0.000 ms
[fil@lair ~]$ curl --verbose --interface ppp0 -4 ya.ru
* Rebuilt URL to: ya.ru/
* Trying 213.180.204.3...
* Local Interface ppp0 is ip 95.104.243.93 using address family 2
* SO_BINDTODEVICE ppp0 failed with errno 1: Operation not permitted; will do regular bind
* Local port: 0