Networking Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationNetworking Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 10th, 2004, 05:36 PM
Ratty Ratty is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 7 Ratty User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Ethernet/server control from a webpage

The setup:
I have a home network setup and functioning with one machine acting as an internet gateway. This gateway box has two ethernet cards (eth0 - connected to the internal network, eth1 - connected to an adsl modem).

At boot, only eth0 is enabled so that I can work on the internal network without exposure to the rest of the world - just in case I wreck the firewall!

The reality:
When I want to go online I SSH into the gateway and enable eth1 to open up to the outside world.

The goal:
As I have Apache2 running (listening to eth0) for the internal network, I would like to be able to just click a link on a restricted page to enable eth1 without the need for SSh access to the gateway.

Does anyone know if the goal is acheivable without too much struggle? If so a pointer in the right direction would be greatfully received, so that I can try and learn the solution if it exists.

At present I have some knowledge (limited) of PHP and JavaScript, would be prepared to dabble in a little bit of PERL if required.

Cheers,

Ratty.

p.s. If this needs to go in a different part of the forums please could a moderator do the honours?

p.p.s. Sorry for the poor formatting - employers IE6 implementation is crippled!

Reply With Quote
  #2  
Old October 12th, 2004, 02:10 PM
cww's Avatar
cww cww is offline
flit, flit, flit...
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: New York City
Posts: 167 cww User rank is Corporal (100 - 500 Reputation Level)cww User rank is Corporal (100 - 500 Reputation Level)cww User rank is Corporal (100 - 500 Reputation Level)cww User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 13 h 24 m 29 sec
Reputation Power: 8
Since you have eth0 and eth1, I assume your router runs Linux. In that case, it'll be fairly easy for you to install and properly configure 'sudo', which is a program that gives regular users one-off root (or other user/group) privileges.

The idea, then, is to write a script that executes something like 'sudo /sbin/ifup eth1' or whatever command you use to bring your interfaces up and then outputs something like 'Cool, it worked' to your browser.

Of course, having a setuid root program immediately accessible from the web is a Bad Thing. At least put some password authentication on it. And read the entirety of the sudo documentation before implementing this.

Colin
__________________
Colin Wetherbee

Reply With Quote
  #3  
Old October 16th, 2004, 08:29 AM
Ratty Ratty is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 7 Ratty User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks CWW for taking the time to reply to my query.

Yes the router is running Linux and SUDO with SSH is my current method of opening up the connection (eth1) to the net.

What I am intending to do based on advice from elsewhere, along with my own thoughts which you have confirmed as feasible, is to use PHPs shell_exec option from a page in an .HTACCESS controlled directory which is only accessible via a set ip/mac combo using a valid password over HTTPS..... and yes, I am a touch paranoid!

Reply With Quote
  #4  
Old October 16th, 2004, 02:50 PM
cww's Avatar
cww cww is offline
flit, flit, flit...
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: New York City
Posts: 167 cww User rank is Corporal (100 - 500 Reputation Level)cww User rank is Corporal (100 - 500 Reputation Level)cww User rank is Corporal (100 - 500 Reputation Level)cww User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 13 h 24 m 29 sec
Reputation Power: 8
Sounds like a plan.

Definitely have that controlled directory with the password authentication!

Colin

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationNetworking Help > Ethernet/server control from a webpage


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT