Open FahadNaim opened 4 years ago
Maybe you bound the server to wrong address?
Here is an example of doing an authentication request:
import pyrad.packet from pyrad.client import Client from pyrad.dictionary import Dictionary
srv=Client(server="radius.my.domain", secret="s3cr3t", dict=Dictionary("dicts/dictionary", "dictionary.acc"))
req=srv.CreateAuthPacket(code=pyrad.packet.AccessRequest, User_Name="wichert", NAS_Identifier="localhost") req["User-Password"]=req.PwCrypt("password")
reply=srv.SendPacket(req) if reply.code==pyrad.packet.AccessAccept: print "access accepted" else: print "access denied"
print "Attributes returned by server:" for i in reply.keys(): print "%s: %s" % (i, reply[i])
And an example for a trivial RADIUS server:
from pyrad import dictionary, packet, server
class FakeServer(server.Server): def _HandleAuthPacket(self, fd, pkt): server.Server._HandleAuthPacket(self, fd, pkt)
reply=self.CreateReplyPacket(pkt)
reply.code=packet.AccessAccept
self.SendReplyPacket(fd, reply)
srv=FakeServer(dict=dictionary.Dictionary("dictionary")) srv.hosts["127.0.0.1"]=server.RemoteHost("127.0.0.1", "s3cr3t", "localhost") srv.BindToAddress("") srv.Run()
from: https://mail.python.org/pipermail/python-announce-list/2004-August/003328.html however, all are the same problem.
I have also encountered this. Unless I'm missing something, leaving an empty string to indicate listening on all interfaces is currently broken. Specify an interface in your call to BindToAddress
for now.
Hi dears, I am doing my project for authentications. I do implement two python scripts for pyrad RADIUS Server and Clints. Both are run, the message sent from the client, however it's do not reach the server, where i run the wireshark which show me the ICMP (port unreachable, UDP RADIUS 1812). Can any one help me please. Thanks in advance.