summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-04-23 12:40:39 +0200
committerChristian Poessinger <christian@poessinger.com>2019-04-23 12:40:39 +0200
commit811479dfe458341bfd6c64714e729545cd03573c (patch)
tree1d84af9fcd0f2a9c7a10af1d0f5505c54e4b2649 /lib
parentbce32de9b73d7ff2d1120ada9c32d9fd022787a8 (diff)
downloadvyatta-cfg-system-811479dfe458341bfd6c64714e729545cd03573c.tar.gz
vyatta-cfg-system-811479dfe458341bfd6c64714e729545cd03573c.zip
T1345: specify RADIUS source IP for system login command
set system login radius-source-address '172.18.201.10'
Diffstat (limited to 'lib')
-rw-r--r--lib/Vyatta/Login/RadiusServer.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Vyatta/Login/RadiusServer.pm b/lib/Vyatta/Login/RadiusServer.pm
index 5a71b1f8..f2e15de2 100644
--- a/lib/Vyatta/Login/RadiusServer.pm
+++ b/lib/Vyatta/Login/RadiusServer.pm
@@ -63,6 +63,10 @@ sub add_pam_radius {
sub update {
my $rconfig = new Vyatta::Config;
+ my $bindaddr = $rconfig->returnValue("system login radius-source-address");
+ if (!defined($bindaddr)) {
+ $bindaddr = "0";
+ }
$rconfig->setLevel("system login radius-server");
my %servers = $rconfig->listNodeStatus();
my $count = 0;
@@ -72,14 +76,14 @@ sub update {
print $cfg "# RADIUS configuration file\n";
print $cfg "# automatically generated do not edit\n";
- print $cfg "# Server\tSecret\tTimeout\n";
+ print $cfg "# server[:port]\t\tshared_secret\t\t\ttimeout (s)\tsource_ip\n";
for my $server ( sort keys %servers ) {
next if ( $servers{$server} eq 'deleted' );
my $port = $rconfig->returnValue("$server port");
my $secret = $rconfig->returnValue("$server secret");
my $timeout = $rconfig->returnValue("$server timeout");
- print $cfg "$server:$port\t$secret\t$timeout\n";
+ print $cfg "$server:$port\t$secret\t$timeout\t$bindaddr\n";
++$count;
print $cfg "priv-lvl 15\n";
print $cfg "mapped_priv_user radius_priv_user\n";