AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[freeradius2](server)

Martin Hope
btongeorge
Asked: 2022-03-01 09:55:19 +0800 CST

FreeRADIUS 只接受一个用户的任何密码

  • 0

无论用户提交的密码如何,我都需要在 FreeRADIUS 上配置一个用户进行身份验证并生成访问接受。我可以看到如何为所有用户执行此操作,但如何为单个用户执行此操作?

radius freeradius freeradius2
  • 1 个回答
  • 314 Views
Martin Hope
Lasse Michael Mølgaard
Asked: 2021-06-02 02:06:33 +0800 CST

当来自 Windows VPN 客户端时,半径身份验证在 Strongswan 中不起作用?

  • 0

我的 strongswan VPN 服务器正在针对本地 Freeradius 服务器对 VPN 客户端进行身份验证。

所有用户日志都被代理到远程 radius 服务器,该服务器根据 Samba Active Directory 服务器验证用户。

但是我遇到了一些问题。

以下部分适用于使用 Strongswan VPN 客户端的 Android 用户:

connections
{
  rw-eap {
    local_addrs = SERVER_PUBLIC_IPV4, SERVER_PUBLIC_IPV6

    local {
      auth = pubkey
      certs = example-ecdsa.cer
      id = vpn.example.com
    }
    remote-android {
      auth = eap-radius
      id = *@example.com
    }
  }
}

监视 Freeradius 的输出显示如下内容:

(5) Received Access-Request Id 135 from 192.168.200.1:47851 to 192.168.200.1:1812 length 193
(5)   User-Name = "[email protected]"
(5)   NAS-Port-Type = Virtual
(5)   Service-Type = Framed-User
(5)   NAS-Port = 4
(5)   NAS-Port-Id = "rw-eap"
(5)   NAS-IP-Address = SERVER_PUBLIC_IPV4
(5)   Called-Station-Id = "SERVER_PUBLIC_IPV4[4500]"
(5)   Calling-Station-Id = "CLIENT_IPV4[3988]"

来自 Strongswan 的日志给出:

06[IKE] IKE_SA rw-eap[6] established between SERVER_PUBLIC_IPV4[vpn.example.com]...CLIENT_IPV4[[email protected]]

但是,当尝试从 Windows 客户端连接到服务器时,除非我在 Strongswan 中使用以下配置,否则它几乎是死在水中:

connections
{
  rw-windows {
    local_addrs = SERVER_PUBLIC_IPV4, SERVER_PUBLIC_IPV6

    local {
      auth = pubkey
      certs = example-ecdsa.cer
      id = vpn.example.com
    }

    remote-windows {
      auth = eap-radius

      # Don't use *@example.com here - as windows does not pass username as id, 
      # so this config will not match in that case.
      id = %any
    }
  }
}

使用此配置,我至少可以让 Strongswan 启动 Radius 身份验证,但我没有比这更进一步。

Freeradius 的输出给了我类似的东西:

(21) Received Access-Request Id 151 from 192.168.200.1:47851 to 192.168.200.1:1812 length 306
(21)   User-Name = "\300\250\000d"
(21)   NAS-Port-Type = Virtual
(21)   Service-Type = Framed-User
(21)   NAS-Port = 7
(21)   NAS-Port-Id = "rw-windows"
(21)   NAS-IP-Address = SERVER_PUBLIC_IPV4
(21)   Called-Station-Id = "SERVER_PUBLIC_IPV4[4500]"
(21)   Calling-Station-Id = "CLIENT_PUBLIC_IPV4[3989]"

这导致 Strongswan 日志中出现以下条目:

06[CFG] looking for peer configs matching SERVER_PUBLIC_IPV4[%any]...CLIENT_PUBLIC_IPV4[CLIENT_PRIVATE_IPV4]

这导致了我的几个问题,例如:

  • 第一:为什么Windows VPN客户端不像Strongswan那样将用户名作为ID传递?

  • 第二:为什么将用户名从 Strongswan 传递给 Freeradius "\300\250\000d"?

在 Windows 客户端上进行更多调试:

上面的示例是在使用 MS-CHAP v2 的客户端上使用 EAP-TTLS 时生成的。

当使用 MS-CHAP 时,Freeradius 确实会使用正确的用户名调用,但是当请求被代理时,用户名/密码身份验证失败。

我想 MS-CHAP 登录需要封装或其他什么,因为身份验证请求的编码与 Android 用户连接时的编码不同?

strongswan freeradius2 eap
  • 1 个回答
  • 421 Views
Martin Hope
Lasse Michael Mølgaard
Asked: 2021-05-23 15:27:48 +0800 CST

如何设置代理半径服务器 (FreeRadius 3)

  • 0

我正在尝试设置一个代理 Freeradius 服务器,将所有请求转发到另一个 Freeradius 服务器。

参考如下图:

通过 VPN 的代理半径服务器

此设置的原因是我希望用户通过 VPN 连接到本地 LAN,但由于 ISP 的 NAT 实施,本地站点无法访问。

但是,我能够建立从本地 LAN 到 VPN 服务器的 site2site VPN 连接,因此我希望用户能够通过公共 VPN 服务器与本地网络建立 VPN 连接,前提是他们是本地网络上的有效用户.

我有一个在本地 LAN 上运行的 Freeradius 服务器,可以根据数据库验证用户 - 这部分工作正常。

配置VPN服务器端

据我了解,我唯一需要在服务器上修改的是文件proxy.conf。

假设登录 VPN 的用户名在表单上,[email protected]​​那么我只需将以下条目添加到proxy.conf:

realm example.com {
    type = radius
    secret = VeryS3cretPassw0rd

    authhost = local-radius.example.com:1812
    accthost = local-radius.example.com:1813

    nostrip
}

该nostrip条目确保代理请求不会@从用户名中删除 -postfix。

我还需要将以下内容添加到/etc/hosts:

   # VPN Address of local-radius.example.com
 
   192.168.100.2   local-radius.example.com

配置本地radius服务器端

在本地半径服务器上,我需要更新client.conf,以便对本地半径服务器和源自 VPN ip 地址的任何查询都是允许的。比如这个条目:

client vpn-net {

        # Allow requests originating from VPN subnet.

        ipaddr          = 192.168.100.0/24
        secret          = VeryS3cretPassw0rd
}

在 VPN 服务器上运行以下命令按预期工作:

radtest -t mschap [email protected] SecretPassword local-radius.example.com:1812 0 VeryS3cretPassw0rd

我收到以下回复:

Sent Access-Request Id 108 from 0.0.0.0:47466 to 192.168.100.2:1812 length 148
        User-Name = "[email protected]"
        MS-CHAP-Password = "SecretPassword "
        NAS-IP-Address = 127.0.1.1
        NAS-Port = 0
        Message-Authenticator = 0x00
        Cleartext-Password = "SecretPassword"
        MS-CHAP-Challenge = ....
        MS-CHAP-Response = ...
Received Access-Accept Id 108 from 192.168.100.2:1812 to 192.168.100.1:47466 length 84
        MS-CHAP-MPPE-Keys = ...
        MS-MPPE-Encryption-Policy = Encryption-Required
        MS-MPPE-Encryption-Types = 4

但是在 VPN 服务器上运行以下命令失败:

radtest -t mschap [email protected] SecretPassword localhost:18120 0 testing123

该命令的输出是:

Sent Access-Request Id 104 from 0.0.0.0:39558 to 127.0.0.1:18120 length 148
        User-Name = "[email protected]"
        MS-CHAP-Password = "SecretPassword"
        NAS-IP-Address = 127.0.1.1
        NAS-Port = 0
        Message-Authenticator = 0x00
        Cleartext-Password = "SecretPassword"
        MS-CHAP-Challenge = ...
        MS-CHAP-Response = ...
Received Access-Reject Id 104 from 127.0.0.1:18120 to 127.0.0.1:39558 length 20
(0) -: Expected Access-Accept got Access-Reject

在 VPN 服务器上运行命令freeradius -X会给出以下输出:

(0) mschap: Found MS-CHAP attributes.  Setting 'Auth-Type  = mschap'
(0)     [mschap] = ok
(0) suffix: Checking for suffix after "@"
(0) suffix: Looking up realm "example.com" for User-Name = "[email protected]"
(0) suffix: Found realm "example.com"
(0) suffix: Adding Realm = "example.com"
(0) suffix: Proxying request from user [email protected] to realm example.com
(0) suffix: Preparing to proxy authentication request to realm "example.com"
(0)     [suffix] = updated
(0) ntdomain: Request already has destination realm set.  Ignoring
(0)     [ntdomain] = noop
(0) eap: No EAP-Message, not doing EAP
(0)     [eap] = noop
(0)     [files] = noop
(0)     [expiration] = noop
(0)     [logintime] = noop
(0)     [pap] = noop
(0)   } # authorize = updated
(0) There was no response configured: rejecting request

在本地网络上监视 freeradius 表明从未从 vpn 服务器调用该服务器,所以我错过了什么?

proxy freeradius freeradius2
  • 1 个回答
  • 3035 Views
Martin Hope
4_dev
Asked: 2016-08-16 03:31:16 +0800 CST

openvpn radius-plugin 不会将 freeradius 中的 framed-ip-address 分配给客户端

  • 1

我是openvpn的新手。我在 ubuntu 14.04 上有一个 openvpn 设置,它有一个用于身份验证、授权和记帐的半径 AAA 后端。除此之外,我们还配置了 freeradius 以将池中的 ips 分配为 framed-ip-address。从半径日志来看,当身份验证和授权成功时,freeradius 似乎返回 framed-ip-address 以响应访问请求消息,但 openvpn 似乎忽略它并使用服务器指令中指定的自己的 ip 池。我想要的是openvpn尊重freeradius返回的框架IP地址,但事实并非如此。由于我之前没有使用 openvpn 的经验,因此我希望得到专家的帮助。

这是我认为有问题的配置的 openvpn 方面。

OpenVPN 配置:

local 192.168.7.100

mode server

port 443 

proto tcp 

dev tun

tcp-queue-limit 256

tun-mtu 1500

mssfix 1460

sndbuf 0

rcvbuf 0


cipher AES-256-CBC

ca /etc/openvpn/easy-rsa/keys/ca.crt

cert /etc/openvpn/easy-rsa/keys/server.crt

key /etc/openvpn/easy-rsa/keys/server.key

dh /etc/openvpn/easy-rsa/keys/dh2048.pem

tls-auth /etc/openvpn/easy-rsa/keys/ta.key 0

plugin /etc/openvpn/rad/radiusplugin.so /etc/openvpn/rad/443.cnf

client-cert-not-required

username-as-common-name


server 10.10.0.0 255.255.0.0

;ifconfig-pool 10.0.0.0 10.1.255.254

ifconfig-pool-persist ipp.txt

push "redirect-gateway def1"

push "dhcp-option DNS 8.8.8.8"

push "dhcp-option DNS 8.8.4.4"

reneg-sec 0

keepalive 60 120

tcp-nodelay

comp-lzo

persist-key

persist-tun

status /etc/openvpn/443.log 1

status-version 1

verb 4

management 192.168.7.100 7505

半径插件:

NAS-Identifier=openvpn_tcp_443

Service-Type=5

Framed-Protocol=1

NAS-Port-Type=5

NAS-IP-Address=192.168.7.100

OpenVPNConfig=/etc/openvpn/tcp_443.conf


subnet=255.255.255.0


overwriteccfiles=true

nonfatalaccounting=false

server
{

        acctport=1813

        authport=1812

        name=192.168.7.102

        retry=1

        wait=1

        sharedsecret=--redacted--
}

server
{

        acctport=1813

        authport=1812

        name=192.168.7.103

        retry=1

        wait=1

        sharedsecret=--redacted--
}

谢谢你。

=======================

更新

我对配置进行了以下更改。

topology subnet

push "topology subnet"

client-config-dir clients

添加 client-config-dir 后,正在分配 framed-ip-address。如前所述,现在从我的客户那里,我无法浏览任何内容。似乎无法正确路由流量。似乎存在路由问题或拓扑或其他我希望 openvpn 处理的问题,但事实并非如此。以下是可以帮助其理解的相关信息。

分配给openvpn客户端的ip是公网ip,路由设置在本机网关上。与 strongswan 一起使用时,相同的客户端 ip 可以正常工作。这意味着它可以正确路由。但是对于openvpn,它不会。

服务器机器上 ifconfig 的相关输出。

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00

          inet addr:10.10.0.1  P-t-P:10.10.0.1  Mask:255.255.255.0

          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:100

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

route -n 的相关输出

0.0.0.0         --redacted--     0.0.0.0         UG    0      0        0 em2

10.10.0.0       0.0.0.0         255.255.255.0   U     0      0        0 tun0

--redacted--     0.0.0.0         255.255.255.248 U     0      0        0 em2

rp_filter 信息:

root@us1-ps1:~# sysctl -a | grep rp_filter

net.ipv4.conf.all.arp_filter = 0

net.ipv4.conf.all.rp_filter = 1

net.ipv4.conf.default.arp_filter = 0

net.ipv4.conf.default.rp_filter = 0

net.ipv4.conf.em1.arp_filter = 0

net.ipv4.conf.em1.rp_filter = 0

net.ipv4.conf.em2.arp_filter = 0

net.ipv4.conf.em2.rp_filter = 0

net.ipv4.conf.lo.arp_filter = 0

net.ipv4.conf.lo.rp_filter = 0

net.ipv4.conf.tun0.arp_filter = 0

net.ipv4.conf.tun0.rp_filter = 0


root@us1-ps1:~# ping 10.10.0.1

PING 10.10.0.1 (10.10.0.1) 56(84) bytes of data.

64 bytes from 10.10.0.1: icmp_seq=1 ttl=64 time=0.058 ms

64 bytes from 10.10.0.1: icmp_seq=2 ttl=64 time=0.037 ms

互联网工作正常。

root@us1-ps1:~# ping google.com

PING google.com (172.217.0.46) 56(84) bytes of data.

64 bytes from lga15s43-in-f14.1e100.net (172.217.0.46): icmp_seq=1 ttl=51 time=20.3 ms

64 bytes from lga15s43-in-f14.1e100.net (172.217.0.46): icmp_seq=2 ttl=51 time=20.2 ms

64 bytes from lga15s43-in-f14.1e100.net (172.217.0.46): icmp_seq=3 ttl=51 time=20.2 ms

^C
--- google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 20.216/20.279/20.338/0.171 ms

默认网关也可以ping通。

如果您想打印其他信息,请告诉我。

谢谢

openvpn freeradius freeradius2
  • 1 个回答
  • 2427 Views
Martin Hope
Korjavin Ivan
Asked: 2012-10-26 07:07:26 +0800 CST

如何接受 freeradius2 中的所有连接?

  • 0

我需要设置接受任何用户名/密码的半径,并为 mpd 提供一些属性。

像这样的东西:(raddb/用户)

DEFAULT Framed-Protocol == PPP                                                                                    
    Service-Type = Framed-User,                                                                                   
    mpd-limit = "out#1=all shape 10240000 pass ",                                                                 
    mpd-limit += "in#1=all rate-limit 2048000 pass",                                                              
    Framed-Pool = "local"

我不关心 auth 、 username 和其他,因为它的备份 radius 和它的任务在我们维护“主要”radiusd 时接受所有连接。

我尝试在可用站点/默认站点中对所有内容进行评论,

我尝试添加 DEFAULT Auth-Type = Accept

我尝试使用 Exec-Program-Wait = 程序总是返回 ok

但是 radius 总是从 mschap 组返回 REJECT,就像这样:

# Executing section authorize from file /usr/local/etc/raddb/sites-enabled/default
+- entering group authorize {...}
++[chap] returns noop
[mschap] Found MS-CHAP attributes.  Setting 'Auth-Type  = mschap'
++[mschap] returns ok
[eap] No EAP-Message, not doing EAP
++[eap] returns noop
[files] users: Matched entry DEFAULT at line 208
++[files] returns ok
Found Auth-Type = MSCHAP
# Executing group from file /usr/local/etc/raddb/sites-enabled/default
+- entering group MS-CHAP {...}
[mschap] No Cleartext-Password configured.  Cannot create LM-Password.
[mschap] No Cleartext-Password configured.  Cannot create NT-Password.
[mschap] Creating challenge hash with username: test
[mschap] Client is using MS-CHAPv2 for test, we need NT-Password
[mschap] FAILED: No NT/LM-Password.  Cannot perform authentication.
[mschap] FAILED: MS-CHAP2-Response is incorrect
++[mschap] returns reject
Failed to authenticate the user.
Login incorrect: [test] (from client localhost port 2 cli 00e05290b3e3 / 00:e0:52:90:b3:e3 / em1)
Using Post-Auth-Type REJECT
# Executing group from file /usr/local/etc/raddb/sites-enabled/default
+- entering group REJECT {...}
[attr_filter.access_reject]     expand: %{User-Name} -> test
attr_filter: Matched entry DEFAULT at line 11
++[attr_filter.access_reject] returns updated
Delaying reject of request 0 for 1 seconds
Going to the next request
Waking up in 0.9 seconds.
Sending delayed reject for request 0
Sending Access-Reject of id 175 to 127.0.0.1 port 64198
        MS-CHAP-Error = "\001E=691 R=1"

请帮帮我。如何为所有用户名/密码设置接受?

freeradius2
  • 1 个回答
  • 7916 Views
Martin Hope
PachinSV
Asked: 2012-06-24 09:20:12 +0800 CST

重新加载 Freeradius 客户端而不重新启动服务

  • 2

有没有办法在不重启服务的情况下重新加载 Freeradius 客户端配置?我在用着:

Ubuntu Server 12
Freeradius 2.1.10
MySQL v5.5.20 (I'm storing the clients in the "nas" table)
configuration freeradius freeradius2 ubuntu-12.04
  • 1 个回答
  • 18530 Views
Martin Hope
artaxerxe
Asked: 2012-06-19 04:46:31 +0800 CST

限制 FreeRADIUS 客户端使用相同的用户和密码从不同的 LAN 访问服务

  • 2

我已经FreeRADIUS安装在我的服务器上,并且还有两个 LAN(或可能更多)由该服务器管理。假设 LAN A:192.168.1.0和 LAN B: 192.168.2.0。我正在与数据库FreeRADIUS结合使用。postgres在我的radcheck表中,我插入了以下行:

userbane='myuser', attribute='Password', op=':=', value='mypass'.

现在我想让从我的 FreeRADIUS 请求服务的客户端只有在属于 LAN B 的一部分时才能使用此用户名和密码对自己进行身份验证。

问题:任何人都可以建议我如何完成这项工作吗?

我试图在radcheck一行中添加更多:username='myuser', attribute='NAS-IP-Address', op=':=', value='192.168.2.1',但没有成功。

任何帮助,将不胜感激。

radius freeradius2
  • 2 个回答
  • 6085 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve