IT-образование
- 5 ответов
- 0 вопросов
5
Вклад в тег
echo «Starting VPN tunnel ...»
modprobe tun
ssh -w ${TUN_LOCAL}:${TUN_REMOTE} -f ${HOST} -p ${HOST_PORT} "\
ip addr add ${IP_REMOTE}/${IP_MASK} dev tun${TUN_REMOTE} \
&& ip link set tun${TUN_REMOTE} up \
&& sleep 2\
&& echo «slept»\
&& iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE -s ${IP_LOCAL}\
&& echo «masq»\
&& iptables -I INPUT -i tun${TUN_REMOTE} -j ACCEPT \
&& iptables -I FORWARD -i tun${TUN_REMOTE} -j ACCEPT \
&& iptables -t nat -I PREROUTING -i tun${TUN_REMOTE} -j ACCEPT \
&& echo «serv done»\
&& true"
sleep 5
echo «local»
ip addr add ${IP_LOCAL}/${IP_MASK} dev tun${TUN_LOCAL}
ip link set tun${TUN_LOCAL} up
ip route del default
ip route add default dev tun${TUN_LOCAL}
#echo «search ${PRIVATE_DOMAIN}
#echo „nameserver ${PRIVATE_NAMESERVER}
#“ >/etc/resolv.conf
echo »… done."
<\blockquote>