LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 08-11-2008, 03:28 PM   #1
DeepSeaNautilus
Member
 
Registered: Jul 2008
Posts: 65

Rep: Reputation: 15
Ifconfig source code help


Hello guys I wanted to get the ip from the server with ifconfig command, but for some reason I don`t have it, when I type ifconfig on the terminal it says Command not found. I looked for the ifconfig source code in the web to compile it with gcc, but I didn`t find it, can anyone please give the c source code or tell where I can get it. Thanks in advance.
 
Old 08-11-2008, 03:42 PM   #2
bzyk
Member
 
Registered: Jun 2007
Location: Poland
Distribution: Debian, Slackware
Posts: 42

Rep: Reputation: 15
Did you do (typing "ifconfig") as a root? If not, then do i as a UID 0 (I mean root). Usually ifconfig is in /sbin directory. And if you type /sbin/ifconfig as a normal user, then it should work...
You can check your ip address (and more), by ip program (but to do it, you must be root). In root mode try to write; ip a show
 
Old 08-11-2008, 03:43 PM   #3
bzyk
Member
 
Registered: Jun 2007
Location: Poland
Distribution: Debian, Slackware
Posts: 42

Rep: Reputation: 15
Did you do (typing "ifconfig") as a root? If not, then do i as a UID 0 (I mean root). Usually ifconfig is in /sbin directory. And if you type /sbin/ifconfig as a normal user, then it should work...
You can check your ip address (and more), by ip program (but to do it, you must be root). In root mode try to write; ip a show
 
Old 08-11-2008, 04:15 PM   #4
framp
Member
 
Registered: Apr 2003
Location: Next to Stuttgart, Germany
Distribution: Debian, Mint, Raspbian
Posts: 131
Blog Entries: 5

Rep: Reputation: 27
Did you try /sbin/ifconfig? Should work as a normal user.
 
Old 08-11-2008, 09:35 PM   #5
DeepSeaNautilus
Member
 
Registered: Jul 2008
Posts: 65

Original Poster
Rep: Reputation: 15
Permission issues

Like you say, the ifconfig command is in /sbin/ifconfig. The problem is that I canīt log on as root on the server, and I donīt have permissions of any kind in that binary. Itīs permissions are:
-rwxr-x--- 1 root root
I have to make a script which outputs several host attributes, but I canīt test it in the server because I donīt have access to that binary.
And since I canīt log on as root, I figured out that the only way of getting that command was by compiling the ifconfig source code, ( like I did with other commands before, such like banner and md5 )but Iīm not sure if that will work because the sources I compiled before only do string operations. Thanks

Last edited by DeepSeaNautilus; 08-11-2008 at 09:55 PM.
 
Old 08-12-2008, 02:12 AM   #6
immortaltechnique
Member
 
Registered: Oct 2006
Location: Kenya
Distribution: Ubuntu, RHEL, OpenBSD
Posts: 287

Rep: Reputation: 32
You need to have sudo priviliges for that to work since ifconfig as earlier pointed out has UID set to 0.
 
Old 08-12-2008, 02:35 AM   #7
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Sure, you can download the source and compile your own version. You can perform any of its non-privileged fucntions.
 
Old 08-13-2008, 12:50 PM   #8
DeepSeaNautilus
Member
 
Registered: Jul 2008
Posts: 65

Original Poster
Rep: Reputation: 15
Possible source code location

Hello guys, I found this link that may be helpful for finding the ifconfig source code. I haven`t verified it yet though.
http://mingzuos.blogspot.com/

Last edited by DeepSeaNautilus; 08-13-2008 at 12:51 PM.
 
  


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
Source-code to ifconfig .. where? sundialsvcs Linux - Software 5 01-04-2009 09:54 AM
Where is the source code for ifconfig? Randux Slackware 9 08-10-2006 09:44 PM
LXer: Voip Encryption, source code open source LXer Syndicated Linux News 0 07-09-2006 03:21 PM
connecting /sbin/ifconfig to bash command ifconfig flammable2 Fedora 4 11-12-2005 07:58 AM

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

All times are GMT -5. The time now is 05:23 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