LinuxQuestions.org
Review your favorite Linux distribution.
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 11-21-2004, 05:42 AM   #1
idit
LQ Newbie
 
Registered: Nov 2004
Posts: 1

Rep: Reputation: 0
Get the default gateway / net mask


I would like to have C code example to how I get the
default gateway and the network mask
Thanks
 
Old 11-21-2004, 08:39 AM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
How about just looking at /proc/net/route?

How to do it in c? See eg. the sources of the route command.
 
  


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
Apache default create mask bbqjeanvaljean Linux - General 1 02-22-2005 08:02 PM
linux net connectivity by gateway wasiulhasan Linux - Networking 0 06-21-2004 01:21 AM
route traffic onto the net from a lan gateway ulto Linux - Networking 1 04-13-2004 08:54 PM
What's a default gateway and do I need one? Travis86 Linux - Newbie 8 05-25-2003 05:44 PM
Invalid net mask CRTSCTS?? justiceisblind Linux - Newbie 5 03-02-2002 01:06 PM

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

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