Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
07-25-2017, 05:28 AM
|
#1
|
LQ Newbie
Registered: Jul 2017
Posts: 1
Rep:
|
What is the command used to check the network connectivity ( not physical link)
c program to check whether the network is through Wifi or through Ethernet and to check the status of the network.
for status example
If mobile hot spot is used, you need to turn on the mobile data else you will be connected to wifi but you cannot access the INTERNET.
how to check the connectivity ???
thanks in advance
|
|
|
07-25-2017, 06:14 AM
|
#2
|
LQ Guru
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,861
|
I always check by pinging 8.8.8.8. That's one of the Google nameservers. If you can ping it, you're connected. And unlike some other methods, it doesn't rely on having working dns.
|
|
1 members found this post helpful.
|
07-25-2017, 06:45 AM
|
#3
|
Senior Member
Registered: Feb 2003
Distribution: debian
Posts: 4,137
|
You can only have ONE default route.
# route -n
$ netstat -r
$ ip link show
$ ip addr show
$ ip route show
# ifconfig -a
# ifconfig
Mostly I just ping 8.8.8.8, and if I know my routers IP, I ping it first to make sure it's not my LAN that's being quirky. Otherwise traceroute can help ID which interface is "next" in your route based on it's "IP".
|
|
1 members found this post helpful.
|
07-25-2017, 03:06 PM
|
#4
|
Member
Registered: May 2011
Location: Texas
Distribution: Primarily Deb/Ubuntu, and some CentOS
Posts: 831
|
ip command will show you what interfaces have what IP, maybe not what you're looking for though...
Last edited by erik2282; 07-25-2017 at 03:10 PM.
|
|
|
07-25-2017, 08:22 PM
|
#5
|
LQ Guru
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
|
Hi jayson_paul,
Welcome to LQ!
You can use nmap to map the network.
Last edited by AwesomeMachine; 07-25-2017 at 08:24 PM.
|
|
|
07-25-2017, 09:03 PM
|
#6
|
LQ Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,538
|
traceroute will tell you the network path to a target. If you have trouble connecting, it can help you spot where the connection is failing.
For example, if you have connectivity within your LAN, but can't get past your router to the Big Wide World, it may be that your modem needs rebooting or replacement. (This happened to me.)
|
|
|
All times are GMT -5. The time now is 10:35 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|