LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-19-2012, 08:42 PM   #1
theClaw
LQ Newbie
 
Registered: Jan 2012
Distribution: Debian Squeeze
Posts: 1

Rep: Reputation: Disabled
Need to show server netmask in browser


I am writing a PHP script to generate a browser form which will allow an admin to view and/or change the IP settings of a Linux-based embedded PC. I can't figure out how to get the netmask value for display. I know I can exec() a system command (ifconfig eth0 blah grep blah cut) to do this, but the script executes as user www-data which means that I would have to mess with the sudoers file and the permissions of ifconfig to allow the script to execute the ifconfig command. Does anyone know of a simpler way?

It just seems odd that it's a simple matter using PHP to get the IP address of the server, but not the netmask!

Thanks in advance,

Chris
 
Old 01-19-2012, 09:00 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,984

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
Run/display netstat to show maybe.

ip and ifconfig are the normal ways to display and set tcp/ip settings. Some other tools could be used.
 
  


Reply



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
how to show network interface card (NIC) info like IP, netmask tnght2001 Linux - General 1 06-23-2010 07:00 AM
ip route config: access an IP in another server's netmask molafish Linux - Server 9 03-19-2009 11:38 AM
dhcp-server ignores netmask Yaniv-Fer Solaris / OpenSolaris 5 11-19-2008 08:50 AM
Samba Server in two diferent netmask? owar Linux - Networking 3 08-26-2004 08:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:50 PM.

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