S
S
SkyChiff2013-11-19 00:49:57
Debian
SkyChiff, 2013-11-19 00:49:57

How to raise 2 pppoe connections at the same time on 2 network cards on the server?

Hello dear ones. Sorry if this is in the wrong place, this is my first post.
Russian is not my native language, if there are amendments, I will be grateful.

Got a question. I crawled all over Google in search of an answer to this question ...

At home there is a server machine with Ddebian installed on it.
4 network interfaces:
1 eth0 looking at the provider's network via dhcp
2 eth1 looking at the same provider's network also via dhcp (2 internets come home, one 65 mb, with a paid one and the second 10 mb. from the ball, since I'm an employee of the same provider, I'm supposed to )
both connections use PPPoE connection type
3 eth2 looks to an unmanaged hub and from the hub to 2 stationary machines, this interface is configured to distribute DHCP 192.168.0.1-255
4 wlan0 is not configured yet, but it is planned to distribute the Internet over the air for 2 laptops through it

QUESTION

How can I raise 2 pppoe connections simultaneously to 2 network cards on the server? How to set up auto-switching between them if eth0 falls (for example, when the money on the account runs out) + distribute the Internet to the local area via eth2 and wlan0 + bind9 apache mysql ftp vpn is installed on the server and so that it all works from the outside through the interface that is currently active , be it eth0 or eth1.

PS The provider does not provide static settings for connecting everything via DHCP.
PPS Please do not hit hard, I used the first post and searched, I did not find anything, please help, who can. I've already torn out all the hair on my head.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GaD_On_Line, 2013-11-26
@GaD_On_Line

The /etc/ppp/ip-down.d and /etc/ppp/ip-up.d folders may contain scripts that run every time a network connection is raised.
At the same time, five parameters are passed to the script
$1 - PPP interface name, $2 - tty, $3 - PPP link speed, $4 - local IP address, $5 - remote IP.
Surely some of them are different for providers, so you can enable looping and write behavior options.
I bring my own, everything primitive was not written for this.
/etc/ppp/ip-down.d/xl2tpd-down
#!/bin/sh
if [ "$3" = "150" ]
then
route add default gw `ip route show|grep $5|awk '{ print $3 }' `
route del -host `ip route show|grep $5|sed 's/via/gw/g'`
fi
/etc/ppp/ip-up.d/xl2tpd-up
#!/bin/sh
if [ "$3" = "150" ]
then
route add -host $5 gw `ip route show|grep default|awk '{print $3" " $4" "$5}'`
route del default
route add default dev $1
fi

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question