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 12-12-2006, 03:40 AM   #1
cnu_sree
LQ Newbie
 
Registered: Dec 2006
Posts: 10

Rep: Reputation: 0
how we found whether net is enabled or not using "c" language


how we found whether net is enabled or not without using ping.
beacuse if i ping my gateways it's working fine.if my system with private ip and if net is diconnected then also it is pinging.
so please tell me how we can find without using the ping using "c"
language
 
Old 12-12-2006, 08:53 AM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
There is no good way to do this other than trying to connect to a robust, well-known internet site such as google or yahoo!

You can check programmatically whether an interface is up, but that will still not tell you if you are connected to the internet or just a LAN, as you have found.
 
Old 12-13-2006, 12:03 AM   #3
cnu_sree
LQ Newbie
 
Registered: Dec 2006
Posts: 10

Original Poster
Rep: Reputation: 0
thank u

i want to verify whether net is connected or not
1.deactivating the echo
2.removing the internet cable
3.net has to be disconnected at server
so these three cases i want to test.
in first two cases pinging our own gateway works.
but in 3rd it's fails
how we can verify in 3 cases
 
  


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
squirrelmail "error in login page"" when content advisor is enabled simi_virgo Linux - Networking 4 08-21-2008 01:25 PM
"Successful install" results in "Boot device not found" slackr007 Fedora 2 06-21-2005 04:05 PM
"Successful install" results in "Boot device not found" slackr007 Linux - Newbie 2 05-31-2005 08:02 PM
Samba 3.0.0 installed on RH WS3, but "net join" command not found chloevu Linux - Networking 0 07-13-2004 03:20 PM
"net ads join" command not found with samba 3.0.2a tisource Linux - Networking 2 04-15-2004 03:38 PM

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

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