Freeradius 綁定到 0.0.0.0 連接埠 1812 的連接埠時發生錯誤

Freeradius 綁定到 0.0.0.0 連接埠 1812 的連接埠時發生錯誤

其他人也遇到過同樣的問題,但所適用的程序不同,在我的場景中不起作用。讓我們下訂單:

RasPi 上的 Freeradius

網路統計:

root@raspberrypi:~# netstat -unpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address   Foreign Address State PID/Program name
udp        0      0 0.0.0.0:59830   0.0.0.0:*             3574/freeradius
udp        0      0 127.0.0.1:18120 0.0.0.0:*             3574/freeradius
udp        0      0 0.0.0.0:1812    0.0.0.0:*             3574/freeradius
udp        0      0 0.0.0.0:1813    0.0.0.0:*             3574/freeradius
udp        0      0 0.0.0.0:1814    0.0.0.0:*             3574/freeradius

使用 freeradius-x 進行調試

Failed binding to authentication address * port 1812: Address already in use
/etc/freeradius/radiusd.conf[240]: Error binding to port for 0.0.0.0 port 1812

root@raspberrypi:~# ps aux | grep free
freerad   3574  0.0  1.3  54088  6032 ?        Ssl  16:32   0:00 /usr/sbin/freeradius
root      3610  0.0  0.4   3548  1832 pts/0    S+   16:35   0:00 grep free

如果我殺死那個進程,我會從 freeradius 調試中得到

 ... adding new socket proxy address * port 50820
Listening on authentication address * port 1812
Listening on accounting address * port 1813
Listening on authentication address 127.0.0.1 port 18120 as server inner-tunnel
Listening on proxy address * port 1814
Ready to process requests.

但 radtest "John Doe" hello 127.0.0.1 0 測試不起作用,因為該服務未運行。有什麼建議麼?

答案1

您可以在偵錯模式下執行伺服器(偵錯日誌來自控制台或轉到檔案)或將其作為實用程式運行。

在調試模式下運行:

freeradius -X 

以下程式碼會將偵錯日誌輸出到檔案並將其推送到背景:

freeradius -x -l /home/user/debug_logs &

將其作為實用程式運行。

/etc/init.d/freeradius start

現在,您無法執行偵錯並且顯示錯誤綁定連接埠錯誤的原因是因為它已經在執行(如 ps 和 netstat 命令所示)。

現在關於您的問題下面的評論:

該錯誤幾乎說明了需要什麼,在您的評論中您發布了 radtest 的調試。

訊息驗證器無效! (共享秘密不正確。)

共享秘密使用“測試" 不正確。本機主機 NAS 的預設共用金鑰是testing123,因此請嘗試使用下列命令執行:

radtest "John Doe" hello 127.0.0.1:18120 0 testing123

如果這也不起作用,請從本機 NAS 轉到clients.conf 搜索,查看寫入的共用金鑰是什麼並使用它。

相關內容