Данные конфиги для подключения к анлиму от интерсвязи.
Получение маршрутов по DHCP:
/etc/dhclient.conf:
timeout 60; retry 60; reboot 10; select-timeout 5; initial-interval 2; interface "rl1" { send dhcp-lease-time 3600; request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, host-name, static-routes, classless-routes; require subnet-mask, domain-name-servers, routers; }
После этого все работает хорошо, но у меня не устанавливался маршрут по умолчанию. Для этого подправим /sbin/dhclient-script.
add_new_routes() { ... if [ -n "$new_classless_routes" ]; then fill_classless_routes "$new_classless_routes" $LOGGER "New Classless Static Routes ($interface): $classless_routes" set $classless_routes while [ $# -gt 1 ]; do if [ "0.0.0.0" = "$2" ]; then route add "$1" -iface "$interface" else route add "$1" "$2" fi shift; shift done #return - комментируем fi ... }
Настраиваем mpd5.
mpd.conf:
pptp_client: create bundle static B1 set iface up-script /usr/local/etc/mpd5/mpd_up.sh set iface down-script /usr/local/etc/mpd5/mpd_down.sh create link static L1 pptp set link action bundle B1 set auth authname "user" set auth password "pass" set link max-redial 0 set link mtu 1500 set link keep-alive 20 75 set pptp peer unlim.is74.ru set pptp disable windowing open
mpd_up.sh:
#!/bin/sh PREFIX=/usr/local export PATH=/sbin:/bin:/usr/bin:/usr/sbin:${PREFIX}/bin:${PREFIX}/sbin netstat -rn | grep '^default' | awk '{print $2}' > /tmp/defaultroute for serverip in `host unlim | awk '{print $4}'` do route add -host $serverip `cat /tmp/defaultroute` done route change default $4
mpd_down.sh:
#!/bin/sh PREFIX=/usr/local export PATH=/sbin:/bin:/usr/bin:/usr/sbin:${PREFIX}/bin:${PREFIX}/sbin route change default `cat /tmp/defaultroute` for serverip in `host unlim | awk '{print $4}'` do route delete -host $serverip done
перечитал весь блог, довольно неплохо