суббота, мая 14, 2005

Быстрый рецепт ppp dialup сервера для linux:
  1. Настраиваем mgetty.
    /etc/mgetty+sendfax/mgetty.config:
    debug 4
    fax-id 7 095 939xxxx
    speed 38400

    port ttyS1
    data-only y
    speed 38400
    /etc/mgetty+sendfax/login.config:
    /AutoPPP/ -     a_ppp   /usr/sbin/pppd
    /etc/inittab:
    S1:2345:respawn:/sbin/mgetty ttyS1
    # telinit q
  2. Настраиваем pppd:
    /etc/ppp/options.ttyS1:
    auth
    crtscts
    192.168.1.1:192.168.1.2
    linkname thepmodem
    ms-dns 213.131.0.1
    refuse-chap
    refuse-mschap
    refuse-mschap-v2
    refuse-eap
    require-pap
    logfile /var/log/ppp/ttyS1.log
    debug
    /etc/ppp/pap-secrets:
    # client        server  secret                  IP addresses
    ivanov * bebebe 192.168.1.2
  3. Настраиваем firewall:

    # iptables -t nat -A POSTROUTING -o eth0 -s 192.168.1.2 -j MASQUERADE
    # /etc/init.d/iptables save
    # sysctl -w net.ipv4.ip_forward=1
    /etc/sysctl.conf:
    net.ipv4.ip_forward = 1
  4. Включаем доступ только на ночь:
    # crontab -e
    0 21 * * * rm -f /etc/nologin.ttyS1
    0 10 * * * touch /etc/nologin.ttyS1

This page is powered by Blogger. Isn't yours?