LinuxAnswers - the LQ Linux tutorial section.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 11-21-2004, 06:42 AM   #1
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
Old 11-21-2004, 09:39 AM   #2
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

All times are GMT -5. The time now is 01:28 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration