Eradius usage

Stephen Gibberd <>
Fri Aug 20 01:54:29 CEST 2004


Hello,

I'm new to erlang and am trying to get eradius from jungerl working.
I've tried the following:

l(et), l(eradius), l(eradius_acc), l(eradius_dict), l(eradius_lib),
l(eradius_server), l(eradius_server_example).
mnesia:start().
eradius:start().
eradius:load_tables(["dictionary"]).
eradius_server:create_tables([]).
eradius_server:define_ras({192,168,79,99},1812,test,{eradius_server_example,test}).
eradius_server:trace_on({192,168,79,99},1812).
eradius_server:start_link({192,168,79,107},1812).

I thought this would use the eradius_server_example:test function to
authenticate any requests coming from 192.168.79.99 but when I test from
192.168.79.99 using this command there is no reply:

  radtest test test 192.168.79.107 1812 test

I tried to trace the radius_server process and saw it calling
eradius_server_example:test correctly (though the function didn't print
anything as I thought it would):
...Many lines deleted....
<0.297.0>: call  eradius_server_example:test({rad_pdu, 125,
  <<201,94,97,46,238,155,177,72,179,85,236,55,140,174,112,96>>, {request,
  [{{attribute,5,integer,"NAS_Port"},1812},
  {{attribute,4,ipaddr,"NAS_IP_Address"},{192,168,79,99}},
  {{attribute,2,string,"User_Password"},
  [237,170,124,54,202,213,211,109,5,130,29,119,238,96,8,132]},
  {{attribute,1,string,"User_Name"},"test"}]}}, {nas_prop, {{192,
  168, 79, 99}, 1812}, test, {eradius_server_example, test}, true})
<0.297.0>: call  eradius_server:encode_reply({rad_accept,
 undefined, [], []}, {rad_pdu, 125,
  <<201,94,97,46,238,155,177,72,179,85,236,55,140,174,112,96>>,
  {request, [{{attribute,5,integer,"NAS_Port"},1812},
  {{attribute,4,ipaddr,"NAS_IP_Address"},{192,168,79,99}},
  {{attribute,2,string,"User_Password"},
  [237,170,124,54,202,213,211,109,5,130,29,119,238,96,8,132]},
  {{attribute,1,string,"User_Name"},"test"}]}}, test)

Eradius_server_example:test seems to return rad_accept as it should,
but the eradius_server:encode_reply function seems to fail:

.... many lines deleted .........
<0.297.0>: call  erlang:md5([<<2,125,0,20>>,
 <<201,94,97,46,238,155,177,72,179,85,236,55,140,174,112,96>>,
  [[],[]],
  test])
<0.297.0>: call  proc_lib:exit_p({'EXIT', {badarg, [{erlang,md5,
          [[<<2,125,0,20>>,
            <<201,94,97,46,238,155,177,72,179,85,236,55,140,174,112,96>>,
            [[],[]],
            test]]},
  {eradius_lib,enc_reply_pdu,2},
  {eradius_server,encode_reply,3},
  {eradius_server,radius,4},
  {proc_lib,init_p,5}]}}, {eradius_server, radius, [<0.99.0>,
  {udp,#Port<0.184>,
       {192,168,79,99},
       32781,
 <<1,125,0,56,201,94,97,46,238,155,177,72,179,85,236,55,140,174,112,96,1,
 6,116,101,115,116,2,18,237,170,124,54,202,213,211,109,5,130,29,119,238,96
 ,8,132,4,6,192,168,79,99,5,6,0,0,7,20>>},
  125,
 {nas_prop,{{192,168,79,99},1812},test,{eradius_server_example,test},true}]})

Any hints or suggestions as to where I'm going wrong?

Thanks, Stephen



More information about the erlang-questions mailing list