Nei*_*eil 5 authentication networking radius
RADIUS 仅在我使用 localhost 时才有效。我不能使用它的 IP 地址。
输出radtest user password localhost 1812 testing123::
Sending Access-Request of id 251 to 127.0.0.1 port 1812
User-Name = "user"
User-Password = "password"
NAS-IP-Address = 127.0.1.1
NAS-Port = 1812
Message-Authenticator = 0x00000000000000000000000000000000
rad_recv: Access-Accept packet from host 127.0.0.1 port 1812, id=251, length=33
Reply-Message = "Hello, user"
Run Code Online (Sandbox Code Playgroud)
但是如果我想使用它的IP地址
的输出radtest user password 192.168.2.218 1812 testing123:
Sending Access-Request of id 28 to 192.168.2.218 port 1812
User-Name = "user"
User-Password = "password"
NAS-IP-Address = 127.0.1.1
NAS-Port = 1812
Message-Authenticator = 0x00000000000000000000000000000000
Sending Access-Request of id 28 to 192.168.2.218 port 1812
User-Name = "user"
User-Password = "password"
NAS-IP-Address = 127.0.1.1
NAS-Port = 1812
Message-Authenticator = 0x00000000000000000000000000000000
Sending Access-Request of id 28 to 192.168.2.218 port 1812
User-Name = "user"
User-Password = "password"
NAS-IP-Address = 127.0.1.1
NAS-Port = 1812
Message-Authenticator = 0x00000000000000000000000000000000
radclient: no response from server for ID 28 socket 3
Run Code Online (Sandbox Code Playgroud)
的输出sudo freeradius -X:
Ignoring request to authentication address * port 1812 from unknown client 192.168.2.218 port 46554
Ready to process requests.
Ignoring request to authentication address * port 1812 from unknown client 192.168.2.218 port 46554
Ready to process requests.
Run Code Online (Sandbox Code Playgroud)
用户输入/etc/freeradius/users:
"user" Cleartext-Password := "password"
Reply-Message = "Hello, %{User-Name}"
Run Code Online (Sandbox Code Playgroud)
中的条目clients.conf:
client 192.168.2.218 {
ipaddr = 192.168.2.218
secret = testing123
}
Run Code Online (Sandbox Code Playgroud)
为了解决这个问题,我必须注释掉client localhost {并ipaddr = 127.0.0.1注释掉/etc/freeradius/clients.conf。
注释掉以下内容
#client localhost {
# Allowed values are:
# dotted quad (1.2.3.4)
# hostname (radius.example.com)
# ipaddr = 127.0.0.1
# OR, you can use an IPv6 address, but not both
# at the same time.
# ipv6addr = :: # any. ::1 == localhost
Run Code Online (Sandbox Code Playgroud)
然后添加
client openwrt {
ipaddr = 192.168.2.1
secret = testing123
require_message_authenticator = yes
Run Code Online (Sandbox Code Playgroud)
允许端口1812和1813
sudo ufw allow 1812
sudo ufw allow 1813
Run Code Online (Sandbox Code Playgroud)