![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Nov 2004
Location: South Africa
Posts: 8
Rep Power: 0
![]() |
We recently got assigned a project where we need to allow access to our server via iptables.
The problem is that we don't know where to start because we come from a Windows environment. If someone has some info that could help us onto the right path we would highly appreciate it! Thanks zdb |
|
|
|
|
|
#2 |
|
Programming Guru
![]() |
Add to top of all pages...
<?php
include("ipCheck.php");
?>ipCheck.php $ips = array("127.0.0.1",
"0.0.0.0");
$access = 0;
foreach($ips as $col => $ip)
if($_SERVER['REMOTE_ADRR'] == $ip) {
$access = 1;
break;
}
if(!$access) {
header("HTTP/1.0 403 Not Authorized");
die();
}
__________________
|
|
|
|
|
|
#3 |
|
Newbie
Join Date: Nov 2004
Location: South Africa
Posts: 8
Rep Power: 0
![]() |
I will give it a bash! Thanks.
zdb |
|
|
|
|
|
#4 |
|
Programming Guru
![]() ![]() |
IpTables as in a firewall?
__________________
Profanity is the one language that all programmers understand. Check out my Blog <---updated Nov 30 2007! |
|
|
|
|
|
#5 |
|
Newbie
Join Date: Nov 2004
Location: South Africa
Posts: 8
Rep Power: 0
![]() |
The main idea behind this IPTable firewall it to deny \ allow access to the network \ server from remote areas. We need to decline access to the network to a wireless access user that should not be able to use our server for the internet. Do you have a way that might help Pizentios?
Thanks |
|
|
|
|
|
#6 | |
|
Newbie
Join Date: Nov 2004
Location: South Africa
Posts: 8
Rep Power: 0
![]() |
Quote:
|
|
|
|
|
|
|
#7 |
|
Programming Guru
![]() |
You'll have to write something that calls the firewall admin screen and gets the information you need with custom HTTP headers sent by your PHP application. This is a fairly complex procedure, i dont think that can be dropped in a firewall config file unless the firewall allows you to include PHP in some odd way, which is doubtful. There are ways to do this but its extremely complicated and takes hours to do...
__________________
|
|
|
|
|
|
#8 | |
|
Programming Guru
![]() ![]() |
Quote:
__________________
Profanity is the one language that all programmers understand. Check out my Blog <---updated Nov 30 2007! |
|
|
|
|
|
|
#9 |
|
Programming Guru
![]() |
Add to top of all pages...
<?php
include("ipCheck.php");
?>ipCheck.php // * is random... you get the idea
$ips = "192.168.1.*";
$access = 1;
$rm = explode(".", $_SERVER['REMOTE_ADDR']);
foreach(explode(".", $ips) as $col => $ip) {
if($ip != "*")
if($ip != $rm[$col]) $access = 0;
}
if(!$access) {
header("HTTP/1.0 403 Not Authorized");
die();
}
__________________
|
|
|
|
|
|
#10 | |
|
Newbie
Join Date: Nov 2004
Location: South Africa
Posts: 8
Rep Power: 0
![]() |
Quote:
I need to be able to deny access to certain remote users to our Server. This would mean that they may not access anything outside their own pc (via our Server anyway) unless the script redirects them. I suppose I could use Java \ Kylix then to interact with the IPTables and manage whoever gets on and off our net using packet filtering? I just thougt it would be easier to set up a script in the IPTable configs. Will my Java \ Delphi (Kylix) approach work, I wonder. Can't see why not. I can do it in Windows and compile to Linux right? Well I'll give it a try then. Tx, Adios |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|