http://wiki.dd-wrt.com/wiki/index.php?title=Dual_Access_PPTP&action=history&feed=atom Dual Access PPTP - Revision history 2024-03-29T09:16:04Z Revision history for this page on the wiki MediaWiki 1.10.1 http://wiki.dd-wrt.com/wiki/index.php?title=Dual_Access_PPTP&diff=37888&oldid=prev Koshika at 12:19, 9 January 2011 2011-01-09T12:19:21Z <p></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 12:19, 9 January 2011</td> </tr> <tr><td colspan="2" align="left"><strong>Line 136:</strong></td> <td colspan="2" align="left"><strong>Line 136:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"># http://forum.tktor.ru/index.php?t=838&amp;amp;o=0&amp;st=0</td><td> </td><td style="background: #eee; font-size: smaller;"># http://forum.tktor.ru/index.php?t=838&amp;amp;o=0&amp;st=0</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Способ №:3</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">При статическом IP:</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">На закладке WAN Setup выбираем PPTP и заполняем в соответствии с тем, что дал провайдер (IP-адрес / логин / пароль /адрес vpn сервеа)</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Далее Administration --&gt; Management --&gt; Устанвить '''Cron''' в режим enable</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Далее Administration --&gt; Command и вбиваем скрипт в '''Startup''' примерно следующего содержания:</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> #!/bin/sh</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> mkdir -p /tmp/cron.d</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> cat &lt;&lt;&quot;ENDOFFILE&quot; &gt; /tmp/fix-pptp-settings.sh</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> if [ &quot;$1&quot; = &quot;--check&quot; ];then</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> if [ &quot;$(nvram get wan_gateway)&quot; != &quot;XXX.XXX.XXX.XXX&quot; ]; then</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> while read param; do</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> nvram set $param</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> sleep 2</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> done &lt;&lt;EOF</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> wan_gateway=XXX.XXX.XXX.XXX</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> wan_netmask=XXX.XXX.XXX.XXX</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> wan_ipaddr=XXX.XXX.XXX.XXX</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> EOF</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> fi</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> elif [ &quot;$1&quot; = &quot;--daemon&quot; ];then</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> while true; do</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> $0 --check</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> sleep 60</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> done</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> fi</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> ENDOFFILE</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> chmod 700 /tmp/fix-pptp-settings.sh</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> sh -c &quot;/tmp/fix-pptp-settings.sh --daemon &amp;&quot;</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Естественно не забыть поставить вместо '''XXX.XXX.XXX.XXX''' свои значения ip-адреса, маски и шлюза.</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Данный скрипт будет запускаться по cron'у раз в минуту и при отвале VPN cкрипт установит все значения на заданные, чтобы снова подключиться через vpn. </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">-------</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">'''Источник:'''</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"># http://www.e1.ru/talk/forum/read.php?f=27&amp;i=171067&amp;t=171067</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">[[Category:Русская документация]]</td><td> </td><td style="background: #eee; font-size: smaller;">[[Category:Русская документация]]</td></tr> </table> Koshika http://wiki.dd-wrt.com/wiki/index.php?title=Dual_Access_PPTP&diff=35515&oldid=prev SagePtr: Changed cyrillic letters to latin 2010-08-31T11:18:09Z <p>Changed cyrillic letters to latin</p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 11:18, 31 August 2010</td> </tr> <tr><td colspan="2" align="left"><strong>Line 17:</strong></td> <td colspan="2" align="left"><strong>Line 17:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">Где-то видел писали, что sed в dd-wrt вырезан на самом деле это не так в стандартной прошивке он присутствует и прекрасно отрабатывает. Проверить действие скрипта можно в консоли с помощью</td><td> </td><td style="background: #eee; font-size: smaller;">Где-то видел писали, что sed в dd-wrt вырезан на самом деле это не так в стандартной прошивке он присутствует и прекрасно отрабатывает. Проверить действие скрипта можно в консоли с помощью</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;"> <del style="color: red; font-weight: bold; text-decoration: none;">сат </del>/tmp/pptpd_client/ip-up</td><td>+</td><td style="background: #cfc; font-size: smaller;"> <ins style="color: red; font-weight: bold; text-decoration: none;">cat </ins>/tmp/pptpd_client/ip-up</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">должна присутствовать строка route del $5 </td><td> </td><td style="background: #eee; font-size: smaller;">должна присутствовать строка route del $5 </td></tr> </table> SagePtr http://wiki.dd-wrt.com/wiki/index.php?title=Dual_Access_PPTP&diff=28254&oldid=prev Anymore at 17:01, 8 December 2009 2009-12-08T17:01:21Z <p></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 17:01, 8 December 2009</td> </tr> <tr><td colspan="2" align="left"><strong>Line 135:</strong></td> <td colspan="2" align="left"><strong>Line 135:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">'''Источник:'''</td><td> </td><td style="background: #eee; font-size: smaller;">'''Источник:'''</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"># http://forum.tktor.ru/index.php?t=838&amp;amp;o=0&amp;st=0</td><td> </td><td style="background: #eee; font-size: smaller;"># http://forum.tktor.ru/index.php?t=838&amp;amp;o=0&amp;st=0</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">[[Category:Русская документация]]</td></tr> </table> Anymore http://wiki.dd-wrt.com/wiki/index.php?title=Dual_Access_PPTP&diff=27731&oldid=prev Tweak at 20:52, 3 November 2009 2009-11-03T20:52:45Z <p></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 20:52, 3 November 2009</td> </tr> <tr><td colspan="2" align="left"><strong>Line 46:</strong></td> <td colspan="2" align="left"><strong>Line 46:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">Настраивать будем с использованием следующих параметров (для каждого отдельного случая могут различаться): </td><td> </td><td style="background: #eee; font-size: smaller;">Настраивать будем с использованием следующих параметров (для каждого отдельного случая могут различаться): </td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">Сеть: 192.168.100.0/24 </td><td>+</td><td style="background: #cfc; font-size: smaller;">&#160;</td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">IP адрес внутри сети: 192.168.100.243 </td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> </ins>Сеть: 192.168.100.0/24 </td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">Роутер для подсети: 192.168.100.1 </td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> </ins>IP адрес внутри сети: 192.168.100.243 </td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">Интерфейс в сеть: vlan1 </td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> </ins>Роутер для подсети: 192.168.100.1 </td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">Наша внутренняя сеть: 172.16.0.0/24 </td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> </ins>Интерфейс в сеть: vlan1 </td></tr> <tr><td>-</td><td style="background: #ffa; font-size: smaller;">IP адрес нашего роутера: 172.16.0.1 </td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> </ins>Наша внутренняя сеть: 172.16.0.0/24 </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"><ins style="color: red; font-weight: bold; text-decoration: none;"> </ins>IP адрес нашего роутера: 172.16.0.1 </td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"></td><td> </td><td style="background: #eee; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">1. Настраиваем соединение PPPoE. </td><td> </td><td style="background: #eee; font-size: smaller;">1. Настраиваем соединение PPPoE. </td></tr> </table> Tweak http://wiki.dd-wrt.com/wiki/index.php?title=Dual_Access_PPTP&diff=27718&oldid=prev Tweak at 22:48, 2 November 2009 2009-11-02T22:48:54Z <p></p> <table border='0' width='98%' cellpadding='0' cellspacing='4' style="background-color: white;"> <tr> <td colspan='2' width='50%' align='center' style="background-color: white;">←Older revision</td> <td colspan='2' width='50%' align='center' style="background-color: white;">Revision as of 22:48, 2 November 2009</td> </tr> <tr><td colspan="2" align="left"><strong>Line 1:</strong></td> <td colspan="2" align="left"><strong>Line 1:</strong></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Способ №1:</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">На закладке WAN Setup выбираем Static или DHCP (в зависимости от того, что дал провайдер), </td><td> </td><td style="background: #eee; font-size: smaller;">На закладке WAN Setup выбираем Static или DHCP (в зависимости от того, что дал провайдер), </td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">далее Services --&gt; PPTP --&gt; PPTP Client (так же заполняем в зависимости что дал провайдер, если нет шифрования - MPPE Encryption оставляем пустой).</td><td> </td><td style="background: #eee; font-size: smaller;">далее Services --&gt; PPTP --&gt; PPTP Client (так же заполняем в зависимости что дал провайдер, если нет шифрования - MPPE Encryption оставляем пустой).</td></tr> <tr><td colspan="2" align="left"><strong>Line 29:</strong></td> <td colspan="2" align="left"><strong>Line 31:</strong></td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;">'''Источник:'''</td><td> </td><td style="background: #eee; font-size: smaller;">'''Источник:'''</td></tr> <tr><td> </td><td style="background: #eee; font-size: smaller;"># http://www.dd-wrt.com/phpBB2/viewtopic.php?p=238332#238332</td><td> </td><td style="background: #eee; font-size: smaller;"># http://www.dd-wrt.com/phpBB2/viewtopic.php?p=238332#238332</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Способ №2:</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">0. Подготовка. </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Для начала надо сменить MAC адрес что смотрит в Вашу сеть</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> ifconfig vlan1 down </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> ifconfig vlan1 hw ether xx:xx:xx:xx:xx:xx </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> ifconfig vlan1 up </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Определить какой именно интерфейс нам нужен можно посмотрев в Status-&gt;Sys-Info в блоке &quot;Router&quot; запоминаем MAC адрес WAN интерефейса . </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Отдаём команду ifconfig и ищем vlan[0-9] у которого MAC совпадает с запомненым раньше :) именно этот интерфейс и нужно тормозить для смены MAC адреса нашего роутера. </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Настраивать будем с использованием следующих параметров (для каждого отдельного случая могут различаться): </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Сеть: 192.168.100.0/24 </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">IP адрес внутри сети: 192.168.100.243 </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Роутер для подсети: 192.168.100.1 </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Интерфейс в сеть: vlan1 </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Наша внутренняя сеть: 172.16.0.0/24 </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">IP адрес нашего роутера: 172.16.0.1 </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">1. Настраиваем соединение PPPoE. </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Идём Setup-&gt;Basic setup выбираем в блоке &quot;WAN Connection Type&quot; , из выпадающего списка &quot;Connection Type&quot; выбираем &quot;PPPoE&quot; . </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Достаточно заполнить только поля &quot;User Name&quot; и &quot;Password&quot; , все остальные чекбоксы выставляем в Disabled ... </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Применяем настройки , если всё хорошо (надеюсь что хорошо) в статусе (в правом верхнем углу) WAN будет указывать на внешний IP адрес вида 94.243.х.х , если оно всё так :) значит у нас есть рабочее соединение с инетом ^_^ идём дальше . </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">2. Настраиваем локальную сеть. </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Дальше придётся шаманить из консоли (мне удобнее, т.к. нету задержки при исполнении команд, или идём в Administration-&gt;Commands) ... </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Чтобы выйти в локалку, необходимо получить плюшевый адрес, поэтому отдаём команды: </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">*всё что ниже начиная со знака # есть комментарии , их вводить не надо. </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> killall udhcpc #убиваем DHCP если оно есть </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> udhcpc -i vlan1 -p /var/run/udhcpc.pid -s /tmp/udhcpc #перезапускаем DHCP </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> ifconfig vlan1 #магия кончилась, если всё ок, то тут увидим наш адрес в локалке </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Всётаки немного магии как выясняется нужно, дело в том что на тестовом роутере не присваивался IP адрес через DHCP, выход из этого есть только один... как ни странно это статический IP адрес для интерфейса, который смотрит в лоеалюную сеть. </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Если у вас всё именно так придётся вводить статику... К примеру будем использовать 192.168.100.243 (адрес для каждого отдельного случая будет свой, этот я взял просто из великого рандома)... выполняем команды: </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> ifconfig vlan1 down </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> ifconfig vlan1 192.168.100.243 netmask 255.255.255.0 </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> ifconfig vlan1 up </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">В итоге получаем , то с чем не справился DHCP клиент. </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">3. Настраиваем маршруты. </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.100.1 </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> route add -net 10.0.2.0 netmask 255.255.255.0 gw 192.168.100.1 </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> route add -net 79.173.126.0 netmask 255.255.255.0 gw 192.168.100.1 </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">4. Настраиваем NAT. </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> iptables -A FORWARD -s 172.16.0.0/24 -j ACCEPT </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> iptables -A FORWARD -d 172.16.0.0/24 -j ACCEPT </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> iptables -t nat -A POSTROUTING -o vlan1 -s 172.16.0.0/24 -j MASQUERADE </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">5. Загрузочный скрипт. </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Добавлять скрипты нужно в Administration-&gt;Commands . </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Startup script </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Необходимо ввести в поле команд и нажать &quot;Save Startup&quot; </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> ifconfig vlan1 down </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> ifconfig vlan1 hw ether xx:xx:xx:xx:xx:xx </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> ifconfig vlan1 up </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> sleep 10 </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> ln -s /sbin/rc /tmp/udhcpc &amp;&amp; udhcpc -i vlan1 -p /var/run/udhcpc.pid -s /tmp/udhcpc </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.100.1 </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> route add -net 10.0.2.0 netmask 255.255.255.0 gw 192.168.100.1 </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> route add -net 79.173.126.0 netmask 255.255.255.0 gw 192.168.100.1 </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Ниже альтернативный Startup Script , в случае со статическим IP адресом </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> ifconfig vlan1 down </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> ifconfig vlan1 hw ether xx:xx:xx:xx:xx:xx </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> ifconfig vlan1 192.168.100.243 netmask 255.255.255.0 </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> ifconfig vlan1 up </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.100.1 </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> route add -net 10.0.2.0 netmask 255.255.255.0 gw 192.168.100.1 </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> route add -net 79.173.126.0 netmask 255.255.255.0 gw 192.168.100.1 </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Firewall script </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Необходимо ввести в поле команд и нажать &quot;Save Firewall&quot; </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> iptables -A FORWARD -s 172.16.0.0/24 -j ACCEPT </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> iptables -A FORWARD -d 172.16.0.0/24 -j ACCEPT </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"> iptables -t nat -A POSTROUTING -o vlan1 -s 172.16.0.0/24 -j MASQUERADE </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">К сожалению не всё так безоблачно в нашем мире и при сохранении скрипта для настройки файрвола роутер уходит в глубокий ребут , как лечить не знаю , но у меня получилось его сохранить только после того как я сохранил его в Custom Script ;) почему оно так я незнаю ... </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">6. Коментарии. </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">Если все пункты выполнены нормально , то у вас рабочий роутер с DualAccess ;) </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">При написании всего этого была использована одна бутылка пива &quot;Asahi&quot; и счастливый пользователь DIR-400 ;) в качестве бета-тестера настроек . </td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">P.S. если вы всётаки дочитали до этого места , то открою страшную тайну ;) досточно выполнить шаг 5 и перезагрузить роутер ...</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">&quot;Tweak&quot;</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">-------</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"></td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;">'''Источник:'''</td></tr> <tr><td colspan="2">&nbsp;</td><td>+</td><td style="background: #cfc; font-size: smaller;"># http://forum.tktor.ru/index.php?t=838&amp;amp;o=0&amp;st=0</td></tr> </table> Tweak http://wiki.dd-wrt.com/wiki/index.php?title=Dual_Access_PPTP&diff=23826&oldid=prev YuriKr: New page: На закладке WAN Setup выбираем Static или DHCP (в зависимости от того, что дал провайдер), далее Services --> PPTP --> PPTP Clie... 2009-01-13T20:47:54Z <p>New page: На закладке WAN Setup выбираем Static или DHCP (в зависимости от того, что дал провайдер), далее Services --&gt; PPTP --&gt; PPTP Clie...</p> <p><b>New page</b></p><div>На закладке WAN Setup выбираем Static или DHCP (в зависимости от того, что дал провайдер), <br /> далее Services --&gt; PPTP --&gt; PPTP Client (так же заполняем в зависимости что дал провайдер, если нет шифрования - MPPE Encryption оставляем пустой).<br /> <br /> Далее Advanced Routing --&gt; Static Routing вбиваем ip vpn-сервера (если он представлен в виде vpn.provaider.ru, ip посмотреть можно через nslookup) через свой шлюз, далее здесь же локальные маршруты и при необходимости на DNS. <br /> <br /> Для Корбины теперь необходимо удалить маршрут на vpn после подъема pptp, для этого идем <br /> Administration --&gt; Commands и вбиваем такой скрипт: <br /> <br /> (while [ ! -f /tmp/pptpd_client/ip-up ]; do sleep 10; done <br /> cp /tmp/pptpd_client/ip-up /tmp/ipup.tmp <br /> sed -e '/keloke/a \ <br /> route del $5' &lt; /tmp/ipup.tmp &gt; /tmp/pptpd_client/ip-up <br /> route del default) &amp;<br /> <br /> Где-то видел писали, что sed в dd-wrt вырезан на самом деле это не так в стандартной прошивке он присутствует и прекрасно отрабатывает. Проверить действие скрипта можно в консоли с помощью<br /> <br /> сат /tmp/pptpd_client/ip-up<br /> <br /> должна присутствовать строка route del $5 <br /> <br /> Нажимаем Save Startup, перезагружаемся и по идее должно все работать. <br /> <br /> Проверить что туннель поднялся можно через команду ifconfig в консоли, должен появиться интерфейс ppp0.<br /> <br /> ''bologov''<br /> <br /> -------<br /> <br /> '''Источник:'''<br /> # http://www.dd-wrt.com/phpBB2/viewtopic.php?p=238332#238332</div> YuriKr