# Failed binding to authentication address: Error binding to port for 0.0.0.0 port 1812



## K_Zend (May 5, 2015)

In `root@BSD-8: radtest alice passme 10.16.0.22 1812 testing123`

I got result:

```
User-Name = "alice"
User-Password = "passme"
NAS-IP-Address = 10.16.0.22
NAS-Port = 1812
Message-Authenticator = 0x0000000000000000000000000000

rad_revc:Access-Accept packet from host 10.16.0.22 port 1812, id=78 length=30
```
At this condition iI run `radiusd -X`. I got error:

```
Failed binding to authentication address 10.16.0.22 port 1812 : Address in use /usr/local/etc/raddb/radiusd.config[229]:Error binding to port for 0.0.0.0 port 1812
```
Then iI get pid of radiusd and kill it.
`ps ax | grep radius
kill -9 PID`
iI run `radiusd -X`. It shows "Ready to process requests".

However when iI run `radtest alice passme 10.16.0.22 1812 testing123`, it shows:

```
radclient : no response from server from ID 227 socket 3
```
I would like to ask is my freeradius server run correctly ? If not, what problem am iI facing. Please help me. Thank you.


----------



## junovitch@ (May 6, 2015)

The failed to bind/address is use suggest another application is using that port.  What does `sockstat | grep 1812` show?


----------



## K_Zend (May 11, 2015)

It show:

```
root     radiusd     1442    13     udp4    *:1812           *:*
root      radiusd      1442      16      udp4      127.0.0.1:18120  *:*
```


----------



## junovitch@ (May 28, 2015)

K_Zend said:


> ```
> rad_revc:Access-Accept packet from host 10.16.0.22 port 1812, id=78 length=30
> ```



Ok, it seems to indicate it receives data.



K_Zend said:


> At this condition iI run `radiusd -X`. I got error:
> 
> ```
> Failed binding to authentication address 10.16.0.22 port 1812 : Address in use /usr/local/etc/raddb/radiusd.config[229]:Error binding to port for 0.0.0.0 port 1812
> ```



This is expected, if the service is already running, then running it again would result in an error when attempting to bind to the port that is already in use.



K_Zend said:


> Then iI get pid of radiusd and kill it.
> `ps ax | grep radius
> kill -9 PID`
> iI run `radiusd -X`. It shows "Ready to process requests".



That makes sense, stopping the service allows it to start again unlike above where it was already running.



K_Zend said:


> However when iI run `radtest alice passme 10.16.0.22 1812 testing123`, it shows:
> 
> ```
> radclient : no response from server from ID 227 socket 3
> ...



It doesn't seem to be actually acting on what it gets sent.  Is there any logs in /var/log related to FreeRadius?  Additionally, is there any configuration options that you can turn on to increase the logging level?  Surely something would be logged somewhere that would indicate why the service doesn't send a reply.


----------

