ALT Linux sysadmins discussion
 help / color / mirror / Atom feed
* [Sysadmins] Setup TUNEL
@ 2007-12-16 21:00 Aleksander N.Gorohovski
  0 siblings, 0 replies; only message in thread
From: Aleksander N.Gorohovski @ 2007-12-16 21:00 UTC (permalink / raw)
  To: sysadmins

Доброго времени суток уважаемое сообщество!

Подскажите как разрешить такую ситуацию.
Раньше (под Master2.2/4) у меня был настроен "тунель" IPIP.

Сейчас в ALT 4.0 для настройки тунеля IPIP делаю так

1.
В файле /etc/iproute2/rt_tables для iptoute2
добавляю строчку
#-----------------------
1  iptun0
#-----------------------

2.
В /etc/rc.d настраиваю файл rc.local
#-----------------------
#!/bin/sh

IP=/sbin/ip
$IP ro add default via 194.44.183.183 table iptun0
$IP ru add from 194.44.183.182 table iptun0

MODULE=ipip
DEVICE=iptun0
TYPE=ipip
PHYSLOCAL=any
PHYSREMOTE=192.168.252.42
TTL=16
TUNLOCAL=194.44.183.182
TUNREMOTE=194.44.183.183
REMOTENETMASKLEN=32

/sbin/modprobe $MODULE

$IP tunnel add $DEVICE mode $TYPE local $PHYSLOCAL remote $PHYSREMOTE ttl  
$TTL
$IP address add $TUNLOCAL peer $TUNREMOTE/$REMOTENETMASKLEN dev $DEVICE
$IP link set dev $DEVICE up
#-----------------------

Но, к сожалению связи нет
:(

Может кто подскажет в какую сторону нужно посмотреть, чтобы выполнить  
правильную настройку.



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 -----------------------
>
  Может подскажите, что необходимо подправить или переделать.

  Спасибо.


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

only message in thread, other threads:[~2007-12-16 21:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-16 21:00 [Sysadmins] Setup TUNEL Aleksander N.Gorohovski

ALT Linux sysadmins discussion

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sysadmins/0 sysadmins/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 sysadmins sysadmins/ http://lore.altlinux.org/sysadmins \
		sysadmins@lists.altlinux.org sysadmins@lists.altlinux.ru sysadmins@lists.altlinux.com
	public-inbox-index sysadmins

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sysadmins


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git