Все делал по статье
http://www.ylsoftware.com/news/649Все работает...только мне надо наоборот...ppp0 основной,eth1 резервный adsl
ifconfigeth0 Link encap:Ethernet HWaddr 00:01:02:0a:1b:46
inet6 addr: fe80::201:2ff:fe0a:1b46/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:54861 errors:0 dropped:0 overruns:0 frame:0
TX packets:29929 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:74120732 (74.1 MB) TX bytes:5509004 (5.5 MB)
Interrupt:16 Base address:0x6c00
eth1 Link encap:Ethernet HWaddr 00:c0:26:2c:00:a7
inet addr:192.168.25.200 Bcast:192.168.25.255 Mask:255.255.255.0
inet6 addr: fe80::2c0:26ff:fe2c:a7/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:42189 errors:0 dropped:0 overruns:0 frame:0
TX packets:57273 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:25743898 (25.7 MB) TX bytes:7015492 (7.0 MB)
Interrupt:17 Base address:0xe800
eth2 Link encap:Ethernet HWaddr 00:23:54:39:b7:30
inet addr:192.168.0.252 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::223:54ff:fe39:b730/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:51315 errors:0 dropped:0 overruns:0 frame:0
TX packets:38641 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:49111534 (49.1 MB) TX bytes:24405924 (24.4 MB)
Память:fe940000-fe960000
lo Link encap:Локальная петля (Loopback)
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:12847 errors:0 dropped:0 overruns:0 frame:0
TX packets:12847 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1864886 (1.8 MB) TX bytes:1864886 (1.8 MB)
ppp0 Link encap:Протокол PPP (Point-to-Point Protocol)
inet addr:95.XX.28.XXX P-t-P:91.XXX.184.XXX Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:51815 errors:0 dropped:0 overruns:0 frame:0
TX packets:29684 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:72796416 (72.7 MB) TX bytes:4840862 (4.8 MB)
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr: P-t-P: Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:4719 errors:0 dropped:0 overruns:0 frame:0
TX packets:4416 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:330697 (330.6 KB) TX bytes:669673 (669.6 KB)
sudo cat /etc/resolv.confnameserver 127.0.0.1
interfacesauto lo
iface lo inet loopback
auto eth1
iface eth1 inet static
address 192.168.25.200
netmask 255.255.255.0
gateway 192.168.25.25
up /etc/network/fw-eth1.sh
dns-nameservers 127.0.0.1
post-up /sbin/ip route add default dev 192.168.25.25 table net_ads
auto eth2
iface eth2 inet static
address 192.168.0.252
netmask 255.255.255.0
dns-nameservers 127.0.0.1
dns-search firma.ru
auto provider
iface provider inet ppp
pre-up /sbin/ifconfig eth0 up # line maintained by pppoeconf
provider provider
# up /etc/network/fw-ppp0.sh
/ppp/ip-up.d/domru#!/bin/sh
# Если это подключение к ТВТ (вот тут пригождается ipparam!)
if [ ${PPP_IPPARAM} = "domru" ]; then
# Заворачиваем трафик через этот интерфейс для соответствующей таблицы
/sbin/ip route add default dev ${PPP_IFACE} table net_domru
fi
rt_tables#
# reserved values
#
255 local
254 main
253 default
0 unspec
#
# local
#
#1 inr.ruhep
195 net_domru
190 net_ads
/etc/ppp/peers/provider# Configuration file for PPP, using PPP over Ethernet
# to connect to a DSL provider.
#
# See the manual page pppd( for information on all the options.
##
# Section 1
#
# Stuff to configure...
# MUST CHANGE: Uncomment the following line, replacing the user@provider.net
# by the DSL user name given to your by your DSL provider.
# (There should be a matching entry in /etc/ppp/pap-secrets with the password.)
#user myusername@myprovider.net
# Use the pppoe program to send the ppp packets over the Ethernet link
# This line should work fine if this computer is the only one accessing
# the Internet through this DSL connection. This is the right line to use
# for most people.
#pty "/usr/sbin/pppoe -I eth0 -T 80 -m 1452"
# An even more conservative version of the previous line, if things
# don't work using -m 1452...
#pty "/usr/sbin/pppoe -I eth0 -T 80 -m 1412"
# If the computer connected to the Internet using pppoe is not being used
# by other computers as a gateway to the Internet, you can try the following
# line instead, for a small gain in speed:
#pty "/usr/sbin/pppoe -I eth0 -T 80"
# The following two options should work fine for most DSL users.
# Assumes that your IP address is allocated dynamically
# by your DSL provider...
noipdefault
# Try to get the name server addresses from the ISP.
usepeerdns
# Use this connection as the default route.
# Comment out if you already have the correct default route installed.
#defaultroute
#replacedefaultroute
##
# Section 2
#
# Uncomment if your DSL provider charges by minute connected
# and you want to use demand-dialing.
#
# Disconnect after 300 seconds (5 minutes) of idle time.
#demand
#idle 300
##
# Section 3
#
# You shouldn't need to change these options...
#Rezerv kanal
unit 0ipparam domru
hide-password
lcp-echo-interval 20
lcp-echo-failure 3
# Override any connect script that may have been set in /etc/ppp/options.
connect /bin/true
noauth
persist
mtu 1492
maxfail 0
# RFC 2516, paragraph 7 mandates that the following options MUST NOT be
# requested and MUST be rejected if requested by the peer:
# Address-and-Control-Field-Compression (ACFC)
noaccomp
# Asynchronous-Control-Character-Map (ACCM)
default-asyncmap
plugin rp-pppoe.so eth0
user "login"
sudo cat /etc/rc.local#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/sbin/ip rule add from 95.XX.28.XXX lookup net_domru pref 20000
/sbin/ip rule add from 192.168.25.200 lookup net_ads pref 20000
exit 0
/etc/bind/named.conf.optionsoptions {
directory "/var/cache/bind";
// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113
// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.
forwarders {
// ns2.nn.ertelecom.ru
91.XXX.184.X;
// ads
192.168.25.25;
};
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
allow-query {192.168.0.0/24; 127.0.0.1;};
listen-on port 53 {192.168.0.252; 127.0.0.1;};
};
Вот так все работает!шлюз доступен по обоим каналам!Только все ходят в инет через ADSL(т.е при перезагрузке или рестарте сети,основной канал ADSL)
Как сдлеать,чтобы при подъеме сети или запуске сервера основной канал был ppp0 + шлюз был доступен по обоим каналам
А то я два часа мучал сервер,так и не добился результата....
основной не работает пока не сделашь
ip route del default ip route add default dev ppp0 metric 100
sudo /etc/network/fw-ppp0.sh
Но после такой манипуляции,шлюз доступен только по ppp0
Подскажите пожалуйста как сделать:
1. доступность по обоим каналам,через интернет
2. Чтобы основной канал был ppp0