LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-15-2014, 05:49 PM   #1
mlewis
Member
 
Registered: Mar 2006
Posts: 187

Rep: Reputation: 16
Protecting Iperf server over internet


I have a number of logging devices which connect home over the internet. Each device calls home using curl, authenticating part htpasswd then onto a php app.

I wanted to add iperf as a test to know where there are bandwidth issues but I need to protect iperf to allow only my own devices to use the server and iperf running as a daemon/service.

Was wondering if anyone in this list might have to thoughts on how this could be done, so that I could retain my htpasswd/php authentication since I already have it in place.

Might there be a way of having php allow the iperf connection perhaps?
And if not iperf, perhaps another variation of it which I've not found on the net yet?

Thanks kindly.
 
Old 11-26-2014, 07:15 PM   #2
MikeDeltaBrown
Member
 
Registered: Apr 2013
Location: Arlington, WA
Distribution: Slackware
Posts: 96

Rep: Reputation: 10
How about starting iperf during boot-up, adding an iptables chain based on the destination port:
Code:
iptables -N IPerfIn
iptables -I INPUT -p tcp --dport 5201 -j IPerfIn
iptables -A IPerfIn -j DROP
...then when your clients "check in" to your PHP app, insert a rule allowing access:

Code:
<?PHP
...
$extCommand='iptables -I IPerfIn -p tcp -s ' . $_SERVER['REMOTE_ADDR'] . ' -j ACCEPT';
$last_line = system($extCommand, $retval);
...
?>
Guess you'd want to remove those rules after a while.....
 
Old 11-26-2014, 09:18 PM   #3
mlewis
Member
 
Registered: Mar 2006
Posts: 187

Original Poster
Rep: Reputation: 16
It isn't safe to let php have access to iptables but thanks.
The way I did it was basically to build a script which regularly processes the allowed IPs then updates the iptables.

This is working fine.
 
  


Reply

Tags
iperf bandwidth secured


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
public iperf server? qwertyjjj Linux - Newbie 5 05-25-2014 05:51 PM
Protecting Domains on a Server mike2010 Linux - Server 6 04-12-2010 04:18 PM
Protecting a multi-user server, per-user limits askest Linux - Software 1 02-08-2010 02:34 PM
Protecting hard drive contents on a deployed server TheCoffeeMug Linux - Server 1 04-30-2008 02:10 PM
protecting data integrity of a server which is always on DJOtaku *BSD 4 09-22-2007 11:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration