Авторизация пользователей VPN (PPTP) только с одного ПК.
Вот mpd5 и есть NAS. Для начала смотрим в его конфиг на предмет строчки set link enable peer-as-calling. Если ее нет, RADIUS не получает Calling-Station-Id. В пятой версии mpd это по умолчанию отключено, а в четвертой - включено.
Посмотреть, что получает RADIUS, можно через tcpdump, запустив его на фре с mpd скажем так: tcpdump -n -i rl0 -p -s 1500 -vv udp port 1812 (rl0 заменить на имя нужной сетевой)
Посмотреть, что получает RADIUS, можно через tcpdump, запустив его на фре с mpd скажем так: tcpdump -n -i rl0 -p -s 1500 -vv udp port 1812 (rl0 заменить на имя нужной сетевой)
Странно.
set link enable peer-as-calling в конфиг добавлен.
выполняю:
tcpdump -n -i em0 -p -s 1500 -vv udp port 1812 на внешний ифейс
и
tcpdump -n -i em1 -p -s 1500 -vv udp port 1812 на внутренний ифейс
результаты одинаково пусты.
В чем проблема может быть - даже не знаю.
Вот полный конфиг mpd5:
Помогите разобраться.
Еще раз благодарю за помощь.
З.Ы. Может и глупый вопрос, но все же спрошу. Конфиг mpd5 должен заканчиваться отступом на новую строку или ему без разницы?
Просто у меня после строки set link enable peer-as-calling нет отступа на новую строку. Может из-за этого он не понимает что мне надо?
set link enable peer-as-calling в конфиг добавлен.
выполняю:
tcpdump -n -i em0 -p -s 1500 -vv udp port 1812 на внешний ифейс
и
tcpdump -n -i em1 -p -s 1500 -vv udp port 1812 на внутренний ифейс
результаты одинаково пусты.
В чем проблема может быть - даже не знаю.
Вот полный конфиг mpd5:
Код: Выделить всё
# cat mpd.conf
#################################################################
#
# MPD configuration file
#
# This file defines the configuration for mpd: what the
# bundles are, what the links are in those bundles, how
# the interface should be configured, various PPP parameters,
# etc. It contains commands just as you would type them
# in at the console. Lines without padding are labels. Lines
# starting with a "#" are comments.
#
# $Id: mpd.conf.sample,v 1.45 2007/11/26 20:41:37 amotin Exp $
#
#################################################################
startup:
# configure mpd users
set user #### ******* admin
# configure the console
set console self 127.0.0.1 5005
set console open
# configure the web server
set web self 10.10.0.1 5006
set web open
#
# Default configuration is "dialup"
default:
load pptp_server
pptp_server:
create bundle template B
set iface enable proxy-arp
set iface idle 0
set iface enable tcpmssfix
set ipcp yes vjcomp
set ipcp ranges 172.16.0.1/32 172.16.0.2/32
set ipcp dns 10.10.0.1
# Enable Microsoft Point-to-Point encryption (MPPE)
set bundle enable compression
set ccp yes mppc
set mppc yes e40
set mppc yes e128
set mppc yes stateless
create link template L pptp
set link enable multilink
set link yes acfcomp protocomp
set link action bundle B
set link no pap chap
set link enable chap
set link enable chap-msv1
set link enable chap-msv2
set link mtu 1460
set link keep-alive 10 75
# Configure PPTP and open link
set pptp self 10.10.0.1
set link enable incoming
set radius config /netup/utm5/radius.conf
set radius server 127.0.0.1 secret secret 1812 1813
set radius retries 3
set radius timeout 3
set radius me 127.0.0.1
set auth acct-update 300
set auth enable radius-auth
set auth enable radius-acct
set radius enable message-authentic
set auth max-logins 1
set link enable peer-as-calling
Еще раз благодарю за помощь.
З.Ы. Может и глупый вопрос, но все же спрошу. Конфиг mpd5 должен заканчиваться отступом на новую строку или ему без разницы?
Просто у меня после строки set link enable peer-as-calling нет отступа на новую строку. Может из-за этого он не понимает что мне надо?
- Lex
- NetUP Team
- Сообщения: 623
- Зарегистрирован: Ср мар 09, 2005 12:12
- Откуда: НетАП
- Контактная информация:
Может всё-таки запросы нужно на интерфейсе lo0 ловить?Andriuxa писал(а):Странно.
set link enable peer-as-calling в конфиг добавлен.
выполняю:
tcpdump -n -i em0 -p -s 1500 -vv udp port 1812 на внешний ифейс
и
tcpdump -n -i em1 -p -s 1500 -vv udp port 1812 на внутренний ифейс
результаты одинаково пусты.
В чем проблема может быть - даже не знаю.
Вот полный конфиг mpd5:Код: Выделить всё
# cat mpd.conf ...... set radius server 127.0.0.1 secret secret 1812 1813 ......
Подправил конфиг.
На машине клиента ip 10.10.10.99.
В VPN-адресе прописан разрешенный CID 10.10.10.99.
Вот tcpdump при, я так понимаю, нормальной авторизации с нужного ip:
Машина авторизовалась.
Затем разрываю соединение, прописываю в разрешенные CID ip-адрес 10.10.10.199 ... и машина снова авторизовалась.
Вот tcpdump:
Объясните в чем проблема.
Заранее благодарен.
На машине клиента ip 10.10.10.99.
В VPN-адресе прописан разрешенный CID 10.10.10.99.
Вот tcpdump при, я так понимаю, нормальной авторизации с нужного ip:
Код: Выделить всё
# tcpdump -n -i lo0 -p -s 1500 -vv udp port 1812
tcpdump: listening on lo0, link-type NULL (BSD loopback), capture size 1500 bytes
08:15:31.815988 IP (tos 0x0, ttl 64, id 21475, offset 0, flags [none], proto: UDP (17), length: 240) 127.0.0.1.60650 > 127.0.0.1.1812: [udp sum ok] RADIUS, length: 212
Access Request (1), id: 0x49, Authenticator: cd13fea342cb0b7e2d10c21e1d83f27c
NAS ID Attribute (32), length: 9, Value: Billing
0x0000: 4269 6c6c 696e 67
NAS IP Address Attribute (4), length: 6, Value: 127.0.0.1
0x0000: 7f00 0001
Message Authentication Attribute (80), length: 18, Value: ./..g.Hg..[....:
0x0000: d82f f2a4 67f7 4867 09f8 5bfb 04ec 9e3a
Accounting Session ID Attribute (44), length: 12, Value: 648131-L-1
0x0000: 3634 3831 3331 2d4c 2d31
NAS Port Attribute (5), length: 6, Value: 1
0x0000: 0000 0001
NAS Port Type Attribute (61), length: 6, Value: Virtual
0x0000: 0000 0005
Service Type Attribute (6), length: 6, Value: Framed
0x0000: 0000 0002
Framed Protocol Attribute (7), length: 6, Value: PPP
0x0000: 0000 0001
Calling Station Attribute (31), length: 13, Value: 10.10.10.99
0x0000: 3130 2e31 302e 3130 2e39 39
Called Station Attribute (30), length: 2, Value:
NAS Port ID Attribute (87), length: 5, Value: em1
0x0000: 656d 31
Vendor Specific Attribute (26), length: 11, Value: Vendor: Unknown (12341)
Vendor Attribute: 12, Length: 3, Value: L-1
0x0000: 0000 3035 0c05 4c2d 31
Username Attribute (1), length: 10, Value: n_andriuxa
0x0000: 6e5f 6e6f 6b73 7476
Vendor Specific Attribute (26), length: 24, Value: Vendor: Microsoft (311)
Vendor Attribute: 11, Length: 16, Value: ..h..,..........
0x0000: 0000 0137 0b12 bb1e 6817 c62c e701 18c0
0x0010: 978f abf2 b6ab
Vendor Specific Attribute (26), length: 58, Value: Vendor: Microsoft (311)
Vendor Attribute: 25, Length: 50, Value: .......pc.Y7...............i..8..W.....y..4.E..l
0x0000: 0000 0137 1934 0100 d0ad a4bb 87f1 7f70
0x0010: 63c6 5937 8202 9ae3 0000 0000 0000 0000
0x0020: 9fe6 0d69 e61d 38c2 0857 b600 ddec bd79
0x0030: b7f9 3485 4505 186c
08:15:33.470281 IP (tos 0x0, ttl 64, id 21596, offset 0, flags [none], proto: UDP (17), length: 213) 127.0.0.1.1812 > 127.0.0.1.60650: [udp sum ok] RADIUS, length: 185
Access Accept (2), id: 0x49, Authenticator: b44a6000214e180af07386aac81a31c7
Framed IP Address Attribute (8), length: 6, Value: 89.237.37.150
0x0000: 59ed 2596
Vendor Specific Attribute (26), length: 51, Value: Vendor: Microsoft (311)
Vendor Attribute: 26, Length: 43, Value: .S=1CC1B9DBD5B0745D2F619235FA3B1F698C0C61C5
0x0000: 0000 0137 1a2d 0153 3d31 4343 3142 3944
0x0010: 4244 3542 3037 3435 4432 4636 3139 3233
0x0020: 3546 4133 4231 4636 3938 4330 4336 3143
0x0030: 35
Vendor Specific Attribute (26), length: 42, Value: Vendor: Microsoft (311)
Vendor Attribute: 17, Length: 34, Value: .-...\..7p...+a....2%Iwr.....0q.
0x0000: 0000 0137 1124 b12d 17a4 dd5c 0dec 3c7f
0x0010: 3770 09f4 132b 6118 9f1a a732 2549 7772
0x0020: ec0f 0bc1 cc30 71ab
Vendor Specific Attribute (26), length: 42, Value: Vendor: Microsoft (311)
Vendor Attribute: 16, Length: 34, Value: ..]..pa7.....oY.5..........>─...-I
0x0000: 0000 0137 1024 bbe2 5de3 0c70 6137 1bed
0x0010: 8db9 cb6f 59d9 352e f419 828d 89c6 81e4
0x0020: 2e3e 80c6 9eea 2d49
Vendor Specific Attribute (26), length: 12, Value: Vendor: Microsoft (311)
Vendor Attribute: 7, Length: 4, Value: ....
0x0000: 0000 0137 0706 0000 0001
Vendor Specific Attribute (26), length: 12, Value: Vendor: Microsoft (311)
Vendor Attribute: 8, Length: 4, Value: ....
0x0000: 0000 0137 0806 0000 0006
Затем разрываю соединение, прописываю в разрешенные CID ip-адрес 10.10.10.199 ... и машина снова авторизовалась.
Вот tcpdump:
Код: Выделить всё
# tcpdump -n -i lo0 -p -s 1500 -vv udp port 1812
tcpdump: listening on lo0, link-type NULL (BSD loopback), capture size 1500 bytes
08:17:20.133496 IP (tos 0x0, ttl 64, id 29098, offset 0, flags [none], proto: UDP (17), length: 240) 127.0.0.1.49467 > 127.0.0.1.1812: [udp sum ok] RADIUS, length: 212
Access Request (1), id: 0x6f, Authenticator: 9b13f6a9fbf6809861be3250290adcb7
NAS ID Attribute (32), length: 9, Value: Billing
0x0000: 4269 6c6c 696e 67
NAS IP Address Attribute (4), length: 6, Value: 127.0.0.1
0x0000: 7f00 0001
Message Authentication Attribute (80), length: 18, Value: %n.Z..A.4.oT{w5.
0x0000: 256e e35a c1e5 41df 34ed 6f54 7b77 3598
Accounting Session ID Attribute (44), length: 12, Value: 648240-L-1
0x0000: 3634 3832 3430 2d4c 2d31
NAS Port Attribute (5), length: 6, Value: 1
0x0000: 0000 0001
NAS Port Type Attribute (61), length: 6, Value: Virtual
0x0000: 0000 0005
Service Type Attribute (6), length: 6, Value: Framed
0x0000: 0000 0002
Framed Protocol Attribute (7), length: 6, Value: PPP
0x0000: 0000 0001
Calling Station Attribute (31), length: 13, Value: 10.10.10.99
0x0000: 3130 2e31 302e 3130 2e39 39
Called Station Attribute (30), length: 2, Value:
NAS Port ID Attribute (87), length: 5, Value: em1
0x0000: 656d 31
Vendor Specific Attribute (26), length: 11, Value: Vendor: Unknown (12341)
Vendor Attribute: 12, Length: 3, Value: L-1
0x0000: 0000 3035 0c05 4c2d 31
Username Attribute (1), length: 10, Value: n_andriuxa
0x0000: 6e5f 6e6f 6b73 7476
Vendor Specific Attribute (26), length: 24, Value: Vendor: Microsoft (311)
Vendor Attribute: 11, Length: 16, Value: ..h.$Q..─......w
0x0000: 0000 0137 0b12 bb1e 68be 2451 bcf9 80ab
0x0010: c892 8ea2 bc77
Vendor Specific Attribute (26), length: 58, Value: Vendor: Microsoft (311)
Vendor Attribute: 25, Length: 50, Value: ......3.....^....F...........{.O..I....+..A{....\3
0x0000: 0000 0137 1934 0100 c406 dded 33ce d5e7
0x0010: a3af 5eb1 f4d4 ad46 0000 0000 0000 0000
0x0020: 8d81 b07b 874f 818a 49af ccc4 862b dd0a
0x0030: 417b b784 a416 5c33
08:17:21.796201 IP (tos 0x0, ttl 64, id 29215, offset 0, flags [none], proto: UDP (17), length: 213) 127.0.0.1.1812 > 127.0.0.1.49467: [udp sum ok] RADIUS, length: 185
Access Accept (2), id: 0x6f, Authenticator: eeb544c1f5d1db961aa64713c96bb7bb
Framed IP Address Attribute (8), length: 6, Value: 89.237.37.150
0x0000: 59ed 2596
Vendor Specific Attribute (26), length: 51, Value: Vendor: Microsoft (311)
Vendor Attribute: 26, Length: 43, Value: .S=30BE79248DED34B53AEEBA355C6EF3974ED92925
0x0000: 0000 0137 1a2d 0153 3d33 3042 4537 3932
0x0010: 3438 4445 4433 3442 3533 4145 4542 4133
0x0020: 3535 4336 4546 3339 3734 4544 3932 3932
0x0030: 35
Vendor Specific Attribute (26), length: 42, Value: Vendor: Microsoft (311)
Vendor Attribute: 17, Length: 34, Value: .hi..u....4.ZoaB...S...4.....~o!(g
0x0000: 0000 0137 1124 c068 69f4 cc75 f392 0c8e
0x0010: 34e5 5a6f 6142 faa8 1553 d0f3 ff34 f40e
0x0020: f600 e87e 6f21 2867
Vendor Specific Attribute (26), length: 42, Value: Vendor: Microsoft (311)
Vendor Attribute: 16, Length: 34, Value: .yBU;.P.?...Kpo.D.H...lv......!...
0x0000: 0000 0137 1024 c979 4255 3b04 5093 3f84
0x0010: edc8 4b70 6fc2 44a2 48de 8f85 6c76 fcce
0x0020: ef8d be85 21fb e0a1
Vendor Specific Attribute (26), length: 12, Value: Vendor: Microsoft (311)
Vendor Attribute: 7, Length: 4, Value: ....
0x0000: 0000 0137 0706 0000 0001
Vendor Specific Attribute (26), length: 12, Value: Vendor: Microsoft (311)
Vendor Attribute: 8, Length: 4, Value: ....
0x0000: 0000 0137 0806 0000 0006
Заранее благодарен.
Разрешенный CID обрабатывается как регулярное выражение. Я не знаю, применяется ли там точное сравнение или нет. Поэтому попробуйте еще вот так - ^10\.10\.10\.99$
Сам этим не заморачивался, потому что прикрутил FreeRadius, и сделал контроль сначала сравнением, затем OR и как регулярное. Что сошлось - по тому и пустит.
Сам этим не заморачивался, потому что прикрутил FreeRadius, и сделал контроль сначала сравнением, затем OR и как регулярное. Что сошлось - по тому и пустит.
Код: Выделить всё
[b]...[/b]
sql_user_name = "%{User-Name}"
authorize_check_query = "SELECT ip_groups.id AS id,ip_groups.uname AS login,'Password',ip_groups.upass AS password,'==' FROM UTM5.ip_groups,UTM5.iptraffic_service_links,UTM5.service_links,UTM5.accounts WHERE ip_groups.uname = '%{SQL-User-Name}' AND ip_groups.is_deleted = '0' AND iptraffic_service_links.is_deleted = '0' AND service_links.is_deleted = '0' AND accounts.is_deleted = '0' AND accounts.int_status = '1' AND ip_groups.ip_group_id = iptraffic_service_links.ip_group_id AND iptraffic_service_links.id = service_links.id AND service_links.account_id = accounts.id ORDER BY ip_groups.id"
Без проблем
Код: Выделить всё
authorize_check_query = "SELECT ip_groups.id AS id,ip_groups.uname AS login,'Password',ip_groups.upass AS password,'==' FROM UTM5.ip_groups,UTM5.iptraffic_service_links,UTM5.service_links,UTM5.accounts WHERE ip_groups.uname = '%{SQL-User-Name}' AND ip_groups.is_deleted = '0' AND iptraffic_service_links.is_deleted = '0' AND service_links.is_deleted = '0' AND accounts.is_deleted = '0' AND accounts.int_status = '1' AND ip_groups.ip_group_id = iptraffic_service_links.ip_group_id AND iptraffic_service_links.id = service_links.id AND service_links.account_id = accounts.id AND ('%{Calling-Station-Id}'=ip_groups.allowed_cid OR '%{Calling-Station-Id}' REGEXP ip_groups.allowed_cid)"