CID + pptpd
CID + pptpd
Добрый день!
Понадобилось посмотреть историю откуда поднимали VPN, раньще если не ошибаюсь в UTM3/4 такой функционал был.
OS: Freebsd 5.4
pptpd стоит версии 1.2.3
compat4x установлен
в ps ax | grep pp
root 2516 0.0 0.2 1320 792 ?? S 10:16AM 0:03.85 pptpctrl : pptpd [10.1.1.73:8000 - 3500] (pptpctrl)
root 2517 0.0 0.4 3428 2104 ?? S 10:16AM 0:05.56 /usr/sbin/ppp -direct pptp
Те видно что сессия поднята с 10.1.1.73
А как заставить это писаться в логи ppp.log, чтобы можно было отследить откуда поджнимался ВПН.
Спасибо
Посоветовали поставить, pptpd 1.3.x
root@accounter2# make
make all-am
gcc -DHAVE_CONFIG_H -I. -I. -I. -I. -O2 -fno-builtin -Wall -DSBINDIR='"/usr/local/sbin"' -c pqueue.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -I. -O2 -fno-builtin -Wall -DSBINDIR='"/usr/local/sbin"' -c pptpd.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -I. -O2 -fno-builtin -Wall -DSBINDIR='"/usr/local/sbin"' -c configfile.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -I. -O2 -fno-builtin -Wall -DSBINDIR='"/usr/local/sbin"' -c pptpmanager.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -I. -O2 -fno-builtin -Wall -DSBINDIR='"/usr/local/sbin"' -c compat.c
compat.c: In function `my_setproctitle':
compat.c:123: warning: implicit declaration of function `setproctitle'
In file included from compat.c:129:
/usr/include/unistd.h: At top level:
/usr/include/unistd.h:360: error: conflicting types for 'setproctitle'
compat.c:123: error: previous implicit declaration of 'setproctitle' was here
compat.c: In function `sigpipe_assign':
compat.c:177: warning: implicit declaration of function `memset'
*** Error code 1
Stop in /usr/local/pptpd-1.3.2.
*** Error code 1
Stop in /usr/local/pptpd-1.3.2.
Похоже из за того что под линуха заточены.
пробовал собирать и gmake'ом и make'ом
Понадобилось посмотреть историю откуда поднимали VPN, раньще если не ошибаюсь в UTM3/4 такой функционал был.
OS: Freebsd 5.4
pptpd стоит версии 1.2.3
compat4x установлен
в ps ax | grep pp
root 2516 0.0 0.2 1320 792 ?? S 10:16AM 0:03.85 pptpctrl : pptpd [10.1.1.73:8000 - 3500] (pptpctrl)
root 2517 0.0 0.4 3428 2104 ?? S 10:16AM 0:05.56 /usr/sbin/ppp -direct pptp
Те видно что сессия поднята с 10.1.1.73
А как заставить это писаться в логи ppp.log, чтобы можно было отследить откуда поджнимался ВПН.
Спасибо
Посоветовали поставить, pptpd 1.3.x
root@accounter2# make
make all-am
gcc -DHAVE_CONFIG_H -I. -I. -I. -I. -O2 -fno-builtin -Wall -DSBINDIR='"/usr/local/sbin"' -c pqueue.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -I. -O2 -fno-builtin -Wall -DSBINDIR='"/usr/local/sbin"' -c pptpd.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -I. -O2 -fno-builtin -Wall -DSBINDIR='"/usr/local/sbin"' -c configfile.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -I. -O2 -fno-builtin -Wall -DSBINDIR='"/usr/local/sbin"' -c pptpmanager.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -I. -O2 -fno-builtin -Wall -DSBINDIR='"/usr/local/sbin"' -c compat.c
compat.c: In function `my_setproctitle':
compat.c:123: warning: implicit declaration of function `setproctitle'
In file included from compat.c:129:
/usr/include/unistd.h: At top level:
/usr/include/unistd.h:360: error: conflicting types for 'setproctitle'
compat.c:123: error: previous implicit declaration of 'setproctitle' was here
compat.c: In function `sigpipe_assign':
compat.c:177: warning: implicit declaration of function `memset'
*** Error code 1
Stop in /usr/local/pptpd-1.3.2.
*** Error code 1
Stop in /usr/local/pptpd-1.3.2.
Похоже из за того что под линуха заточены.
пробовал собирать и gmake'ом и make'ом
Интересует у тех у кого FREEBSD.
Сейчас имеем:
Oct 3 16:26:20 accounter2 ppp[19400]: Phase: PPP Started (direct mode).
Oct 3 16:26:20 accounter2 ppp[19400]: Phase: bundle: Establish
Oct 3 16:26:20 accounter2 ppp[19400]: Phase: deflink: closed -> opening
Oct 3 16:26:20 accounter2 ppp[19400]: Phase: deflink: Connected!
Oct 3 16:26:20 accounter2 ppp[19400]: Phase: deflink: opening -> carrier
Oct 3 16:26:20 accounter2 ppp[19400]: Phase: deflink: carrier -> lcp
Oct 3 16:26:20 accounter2 ppp[19400]: Phase: bundle: Authenticate
Oct 3 16:26:20 accounter2 ppp[19400]: Phase: deflink: his = none, mine = CHAP 0x05
Oct 3 16:26:20 accounter2 ppp[19400]: Phase: Chap Output: CHALLENGE
Oct 3 16:26:20 accounter2 ppp[19400]: Phase: Chap Input: RESPONSE (16 bytes from USERNAME_FROM_UTM)
Oct 3 16:26:20 accounter2 ppp[19400]: Phase: Radius: Request sent
Oct 3 16:26:21 accounter2 ppp[19400]: Phase: Radius(auth): ACCEPT received
Oct 3 16:26:21 accounter2 ppp[19400]: Phase: IP 172.16.1.106
Oct 3 16:26:21 accounter2 ppp[19400]: Phase: Netmask 255.255.255.255
Oct 3 16:26:21 accounter2 ppp[19400]: Phase: Session-Timeout 86400
Oct 3 16:26:21 accounter2 ppp[19400]: Phase: Chap Output: SUCCESS
Oct 3 16:26:21 accounter2 ppp[19400]: Phase: deflink: lcp -> open
Oct 3 16:26:21 accounter2 ppp[19400]: Phase: bundle: Network
Oct 3 16:26:21 accounter2 ppp[19400]: Phase: deflink: IPV6CP protocol reject closes IPV6CP !
Oct 3 16:26:21 accounter2 ppp[19400]: Phase: deflink: IPV6CP protocol reject closes IPV6CP !
Oct 3 16:26:21 accounter2 ppp[19400]: Phase: Radius(acct): START data sent
Oct 3 16:26:24 accounter2 ppp[19400]: Phase: deflink: IPV6CP protocol reject closes IPV6CP !
Oct 3 16:26:27 accounter2 ppp[19400]: Phase: deflink: IPV6CP protocol reject closes IPV6CP !
Oct 3 16:26:27 accounter2 ppp[19400]: Phase: deflink: open -> lcp
Oct 3 16:26:27 accounter2 ppp[19400]: Warning: ff02:2e::/32: Change route failed: errno: Network is unreachable
Oct 3 16:26:27 accounter2 ppp[19400]: Phase: Radius(acct): STOP data sent
Oct 3 16:26:27 accounter2 ppp[19400]: Phase: bundle: Terminate
----------
конфигурация:
/etc/ppp/pptp.conf
loop:
set timeout 0
set ifaddr 172.16.0.1 10.0.0.1-10.254.254.254 255.255.255.255
pptp:
load loop
set timeout 0
disable acfcomp vj pred1 deflate deflate24 protocomp shortseq
deny acfcomp vj pred1 deflate deflate24 protocomp shortseq
set mtu 1450
set mru 1450
enable MSCHAPv2
enable MSCHAP
enable CHAP
set radius /etc/radius.conf
enable lqr
set lqrperiod 10
enable lqr echo
установка set log ALL не помогает, всё что угодно в логах, но адресов из сети 10.0.0.0/8 (локальная сеть) не видно.
Установлен:
poptop-1.2.3_1 Windows 9x compatible PPTP (VPN) server
Сейчас имеем:
Oct 3 16:26:20 accounter2 ppp[19400]: Phase: PPP Started (direct mode).
Oct 3 16:26:20 accounter2 ppp[19400]: Phase: bundle: Establish
Oct 3 16:26:20 accounter2 ppp[19400]: Phase: deflink: closed -> opening
Oct 3 16:26:20 accounter2 ppp[19400]: Phase: deflink: Connected!
Oct 3 16:26:20 accounter2 ppp[19400]: Phase: deflink: opening -> carrier
Oct 3 16:26:20 accounter2 ppp[19400]: Phase: deflink: carrier -> lcp
Oct 3 16:26:20 accounter2 ppp[19400]: Phase: bundle: Authenticate
Oct 3 16:26:20 accounter2 ppp[19400]: Phase: deflink: his = none, mine = CHAP 0x05
Oct 3 16:26:20 accounter2 ppp[19400]: Phase: Chap Output: CHALLENGE
Oct 3 16:26:20 accounter2 ppp[19400]: Phase: Chap Input: RESPONSE (16 bytes from USERNAME_FROM_UTM)
Oct 3 16:26:20 accounter2 ppp[19400]: Phase: Radius: Request sent
Oct 3 16:26:21 accounter2 ppp[19400]: Phase: Radius(auth): ACCEPT received
Oct 3 16:26:21 accounter2 ppp[19400]: Phase: IP 172.16.1.106
Oct 3 16:26:21 accounter2 ppp[19400]: Phase: Netmask 255.255.255.255
Oct 3 16:26:21 accounter2 ppp[19400]: Phase: Session-Timeout 86400
Oct 3 16:26:21 accounter2 ppp[19400]: Phase: Chap Output: SUCCESS
Oct 3 16:26:21 accounter2 ppp[19400]: Phase: deflink: lcp -> open
Oct 3 16:26:21 accounter2 ppp[19400]: Phase: bundle: Network
Oct 3 16:26:21 accounter2 ppp[19400]: Phase: deflink: IPV6CP protocol reject closes IPV6CP !
Oct 3 16:26:21 accounter2 ppp[19400]: Phase: deflink: IPV6CP protocol reject closes IPV6CP !
Oct 3 16:26:21 accounter2 ppp[19400]: Phase: Radius(acct): START data sent
Oct 3 16:26:24 accounter2 ppp[19400]: Phase: deflink: IPV6CP protocol reject closes IPV6CP !
Oct 3 16:26:27 accounter2 ppp[19400]: Phase: deflink: IPV6CP protocol reject closes IPV6CP !
Oct 3 16:26:27 accounter2 ppp[19400]: Phase: deflink: open -> lcp
Oct 3 16:26:27 accounter2 ppp[19400]: Warning: ff02:2e::/32: Change route failed: errno: Network is unreachable
Oct 3 16:26:27 accounter2 ppp[19400]: Phase: Radius(acct): STOP data sent
Oct 3 16:26:27 accounter2 ppp[19400]: Phase: bundle: Terminate
----------
конфигурация:
/etc/ppp/pptp.conf
loop:
set timeout 0
set ifaddr 172.16.0.1 10.0.0.1-10.254.254.254 255.255.255.255
pptp:
load loop
set timeout 0
disable acfcomp vj pred1 deflate deflate24 protocomp shortseq
deny acfcomp vj pred1 deflate deflate24 protocomp shortseq
set mtu 1450
set mru 1450
enable MSCHAPv2
enable MSCHAP
enable CHAP
set radius /etc/radius.conf
enable lqr
set lqrperiod 10
enable lqr echo
установка set log ALL не помогает, всё что угодно в логах, но адресов из сети 10.0.0.0/8 (локальная сеть) не видно.
Установлен:
poptop-1.2.3_1 Windows 9x compatible PPTP (VPN) server
pptpd передает адрес "звонящего" в pppd в параметре -ipparamdemiurg писал(а):А если в /netup/utm5/log/radius5.log посмотреть? Всё как на ладони
а pppd - зараза не передаёт этот адрес в auth-up. Что лечится однострочным патчем pppd. у меня например туннели поднимаются только для ип адреса абонента в сети.
--- ppp-2.4.2_/pppd/auth.c 2006-08-23 23:28:38 +0400kirush писал(а):Подскажите по поводу патча.
+++ ppp-2.4.2/pppd/auth.c 2006-08-24 00:05:17 +0400
@@ -2430,7 +2430,8 @@
argv[3] = user_name;
argv[4] = devnam;
argv[5] = strspeed;
- argv[6] = NULL;
+ argv[6] = ipparam;
+ argv[7] = NULL;
auth_script_pid = run_program(script, argv, 0, auth_script_done, NULL);
}
И соответственно Ваш patch не работает. Поскольку auth_script_done в нем auht.c нет.auth.c писал(а):static void
auth_script(script)
char *script;
{
char strspeed[32];
struct passwd *pw;
char struid[32];
char *user_name;
char *argv[8];
if ((pw = getpwuid(getuid())) != NULL && pw->pw_name != NULL)
user_name = pw->pw_name;
else {
sprintf(struid, "%d", getuid());
user_name = struid;
}
sprintf(strspeed, "%d", baud_rate);
argv[0] = script;
argv[1] = ifname;
argv[2] = peer_authname;
argv[3] = user_name;
argv[4] = devnam;
argv[5] = strspeed;
argv[6] = NULL;
run_program(script, argv, 0);
}
#cat auth.c |grep auth_script_done
#