Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 16th, 2004, 7:14 AM   #1
zdb
Newbie
 
Join Date: Nov 2004
Location: South Africa
Posts: 8
Rep Power: 0 zdb is on a distinguished road
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
zdb is offline   Reply With Quote
Old Nov 16th, 2004, 8:11 AM   #2
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
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();
}
__________________

tempest is offline   Reply With Quote
Old Nov 16th, 2004, 8:21 AM   #3
zdb
Newbie
 
Join Date: Nov 2004
Location: South Africa
Posts: 8
Rep Power: 0 zdb is on a distinguished road
I will give it a bash! Thanks.

zdb
zdb is offline   Reply With Quote
Old Nov 16th, 2004, 8:21 AM   #4
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
IpTables as in a firewall?
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Old Nov 18th, 2004, 3:45 AM   #5
zdb
Newbie
 
Join Date: Nov 2004
Location: South Africa
Posts: 8
Rep Power: 0 zdb is on a distinguished road
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
zdb is offline   Reply With Quote
Old Nov 18th, 2004, 4:23 AM   #6
zdb
Newbie
 
Join Date: Nov 2004
Location: South Africa
Posts: 8
Rep Power: 0 zdb is on a distinguished road
Quote:
Originally posted by tempest@Nov 16 2004, 02:11 PM
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();
}
Is it possible to include this in a Firewall config file?
zdb is offline   Reply With Quote
Old Nov 18th, 2004, 7:05 AM   #7
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
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...
__________________

tempest is offline   Reply With Quote
Old Nov 18th, 2004, 10:35 AM   #8
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
Quote:
Originally posted by zdb@Nov 18 2004, 04:45 AM
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
What about using public and private keys. Only problem with that is that thew users will have to have they're own public key on what ever computer that they want to use.
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote
Old Nov 18th, 2004, 6:49 PM   #9
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
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();
}
__________________

tempest is offline   Reply With Quote
Old Nov 20th, 2004, 4:50 AM   #10
zdb
Newbie
 
Join Date: Nov 2004
Location: South Africa
Posts: 8
Rep Power: 0 zdb is on a distinguished road
Quote:
Originally posted by tempest@Nov 18 2004, 01:05 PM
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...
If it is not possible to add php to my firewall scripts, then how else should I approach it?

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
zdb is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:38 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC