From: "Aleksander N. Gorohovski" <angel@feht.dgtu.donetsk.ua> To: "ALT Linux Community" <community@lists.altlinux.org> Subject: [Comm] tunel Date: Mon, 03 Dec 2007 12:04:34 +0200 Message-ID: <op.t2q7lwyihz2pp6@oc.peooc.net> (raw) Уважаемое сообщество, прошу прощения, что возвращают опять к этой теме (из-за сбоя электроэнергии вышел из строя винт на сервере и приходится восстанавливать / переустанавливать практически всё). Прочитал http://www.freesource.info/wiki/AltLinux/Sisyphus/admin/etcnet&#iptun "Настройка и использование IP-туннелей" и возникло несколько вопросов. Надо ли для настройки тунеля IPIP делать сейчас в ALT 4.0 1. В файле /etc/iproute2/rt_tables добавлять строчку #----------------------- 1 iptun0 #----------------------- ? 2. В /etc/rc.d настраивать файл rc.local например, #----------------------- #!/bin/sh /sbin/ip ro add default via 194.44.183.183 table iptun0 /sbin/ip ru add from 194.44.183.182 table iptun0 #----------------------- ? 3. Раньше в Master 2.2/4 в /etc/sysconfig/network-scripts/ клал три фала: ifcfg-iptun0 ifdown-iptun ifup-iptun 3.1. ################## # cat ifcfg-iptun0 DEVICE=iptun0 TUNLOCAL=194.44.183.182 TUNREMOTE=194.44.183.183 PHYSLOCAL=any PHYSREMOTE=192.168.252.42 TTL=16 MODE=ipip ONBOOT=yes #------------------- Теперь, если я правильно понял нужно делать иначе. Настройки из ifcfg-iptun0 полжил в файл # cat /etc/net/ifaces/iptun0/options TYPE=iptun TUNTYPE=ipip TUNLOCAL=194.44.183.182 TUNREMOTE=194.44.183.183 PHYSLOCAL=any PHYSREMOTE=192.168.252.42 TTL=16 ONBOOT=yes 3.2. ################## По скриптам ifdown-iptun и ifup-iptun. Не знаю, что теперь (в etcnet) нужно использовать взамен скриптов cd /etc/sysconfig/network-scripts/ network-functions source_config ifdown-post ifdup-post Привожу текст ifdown-iptun и ifup-iptun. # cat ifdown-iptun #----- START ---------------------- #!/bin/sh PATH=/sbin:/usr/sbin:/bin:/usr/bin cd /etc/sysconfig/network-scripts . network-functions IP=/sbin/ip CONFIG=$1 [ -f "$CONFIG" ] || CONFIG="ifcfg-$1" source_config if [ -z "$TUNLOCAL" ]; then echo "missing TUNLOCAL"; exit 1 fi [ -x "$IP" ] || { echo "$IP does not exist or is not executable" echo "ifdown-tun for $DEVICE exiting" logger -p daemon.info -t ifdown-tun \ "$IP does not exist or is not executable for $DEVICE" exit 1 } $IP link set dev $DEVICE down $IP address del $TUNLOCAL dev $DEVICE $IP tunnel del $DEVICE exec /etc/sysconfig/network-scripts/ifdown-post "ifcfg-$DEVICE" "$2" #---- END ----------------------- # cat ifup-iptun #----- START ---------------------- #!/bin/sh PATH=/sbin:/usr/sbin:/bin:/usr/bin cd /etc/sysconfig/network-scripts . network-functions IP=/sbin/ip CONFIG=$1 [ -f "$CONFIG" ] || CONFIG="ifcfg-$1" source_config if [ -z "$TUNLOCAL" ]; then echo "missing TUNLOCAL"; exit 1 fi if [ -z "$TUNREMOTE" ]; then echo "missing TUNREMOTE"; exit 1 fi if [ -z "$PHYSLOCAL" ]; then echo "missing PHYSLOCAL"; exit 1 fi if [ -z "$PHYSREMOTE" ]; then echo "missing PHYSREMOTE"; exit 1 fi if [ -z "$TTL" ]; then TTL="inherit" fi if [ -z "$TYPE" ]; then TYPE="ipip" fi if [ -z "$REMOTENETMASKLEN" ]; then REMOTENETMASKLEN=32 fi if [ "$2" = "boot" -a "$ONBOOT" = "no" ]; then exit fi [ -x "$IP" ] || { echo "$IP does not exist or is not executable" echo "ifup-tun for $DEVICE exiting" logger -p daemon.info -t ifup-tun \ "$IP does not exist or is not executable for $DEVICE" exit 1 } case "$TYPE" in ipip) MODULE=ipip ;; gre) MODULE=ip_gre ;; *) echo "tunnel TYPE for $DEVICE must be either 'ipip' or 'gre'" exit 1 esac modprobe $MODULE $IP tunnel add $DEVICE mode $TYPE local $PHYSLOCAL remote $PHYSREMOTE ttl $TTL $OPTIONS $IP address add $TUNLOCAL peer $TUNREMOTE/$REMOTENETMASKLEN dev $DEVICE $IP link set dev $DEVICE up exec /etc/sysconfig/network-scripts/ifup-post "ifcfg-$DEVICE" "$2" #---- END ----------------------- Подскажите, что необходимо подправить или переделать. Туннель не работает и не хотелось бы из-за этого откатываться назад на ALT 2.4. Спасибо.
reply other threads:[~2007-12-03 10:04 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=op.t2q7lwyihz2pp6@oc.peooc.net \ --to=angel@feht.dgtu.donetsk.ua \ --cc=community@lists.altlinux.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
ALT Linux Community general discussions This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 community community/ http://lore.altlinux.org/community \ mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com public-inbox-index community Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.community AGPL code for this site: git clone https://public-inbox.org/public-inbox.git