ALT Linux Community general discussions
 help / color / mirror / Atom feed
* [Comm] tunel
@ 2007-12-03 10:04 Aleksander N. Gorohovski
  0 siblings, 0 replies; only message in thread
From: Aleksander N. Gorohovski @ 2007-12-03 10:04 UTC (permalink / raw)
  To: ALT Linux Community

Уважаемое сообщество,
прошу прощения, что возвращают опять к этой теме
(из-за сбоя электроэнергии вышел из строя  винт на сервере и приходится
восстанавливать / переустанавливать практически всё).

Прочитал
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.

Спасибо.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-12-03 10:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-03 10:04 [Comm] tunel Aleksander N. Gorohovski

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