27

Testing IPv4 connectivity If your network lets pings through, try pinging 8.8.8.8 (a server run by Google). if ping -q -c 1 -W 1 8.8.8.8 >/dev/null; then echo "IPv4 is up" else echo "IPv4 is down" fi Testing IP connectivity and DNS If you only want the test to succeed when DNS is also working, use a host name. if ping -q -c 1 -W 1 google.com >/...


26

I highly recommend against using ping to determine connectivity. There are too many network admins that disable ICMP (the protocol it uses) due to worries about ping flood attacks originating from their networks. Instead, I use a quick test of a reliable server on a port you can expect to be open: if nc -zw1 google.com 443; then echo "we have ...


20

Let's call the machine that has internet access hasinet and the one that doesn't noinet. If you can make an SSH connection from noinet to hasinet You can do this easily with OpenSSH's built-in SOCKS proxy. This command will set up a SOCKS proxy on noinet listening on port 1080: noinet$ ssh -D 1080 hasinet If you can only make SSH connections to noinet ...


17

I assume that users A and B are using the same Linux machine(s) where you are the administrator. (It's not completely clear from your question. If A and B are have their own computers which they are administrators on, it's a completely different problem.) The following command will prevent the user with uid 1234 from sending packets on the interface eth0: ...


16

One method of annoymizing HTTP traffic from the command line is to use tor. This article discusses the method, titled: How to anonymize the programs from your terminal with torify. General steps from article You can install the tor package as follows: Fedora/CentOS/RHEL $ sudo yum install tor Ubuntu/Debian $ sudo apt-get install tor Edit this file /...


13

You can create a hotspot with: nmcli dev wifi hotspot ifname wlp4s0 ssid test password "test1234"


11

You can get somewhat close by querying the public whois database. It'll likely be somewhat difficult to "productify" to handle every possible case, but a reasonable approximation might be: $ whois a.b.c.d | grep -iE ^country: where a.b.c.d is the IP address in question. whois is often installed by default, so this meets a reasonable interpretation of your ...


11

Use another IP locator than ifconfig.me that provides with that information like: Not available anymore as of 2015-03-09 curl -s 'http://geoiplookup.net/geoapi.php?output=countrycode' or: curl -s 'http://geoiplookup.net/geoapi.php?output=country' (see the API for details) or: curl -s http://whatismycountry.com/ | sed -n 's|.*,\(.*\)&...


11

I found that eth0 was not the name of my interface. systemctl enable dhcpcd@enp0s3.service solved the problem. Thank you very much.


10

check iftop and nload iftop does for network usage what top(1) does for CPU usage. It listens to network traffic on a named interface and displays a table of current bandwidth usage by pairs of hosts. Handy for answering the question "why is our ADSL link so slow?". nload is a console application which monitors network traffic and bandwidth usage in ...


10

Installing Archlinux as a Guest on Virtualbox March 15, 2013 11:54 pm Essentially, you can follow this guide, but there are several additional steps to take. https://wiki.archlinux.org/index.php/Installation_guide#Installation To fix the network: /usr/sbin/dhcpcd enp0s3 to check that you can load the dhcp client. ln -s '/usr/lib/systemd/system/dhcpcd@....


10

Rather then make this block using /etc/hosts I'd suggest using a browser addon/plugin such as this one named: BlockSite for Firefox or StayFocusd for Chrome. BlockSite    StayFocusd                      But I want to really use /etc/hosts file ...


9

The thing to remember is that getting used to something new, like a new operating system, is stressful. Unfortunately, I haven't got freeBSD in front of me at the moment, but assuming that there is a driver for your ethernet card (which there is in all likelihood), the first thing you should try at a command prompt is, ifconfig -a This will show you what ...


9

In a terminal: steam --reset This will provide a clean install for the client, but leave all your games untouched. Be aware that although this will "fix" your connection issue, it's akin to buying a new car to fix a flat tire. There is probably a simpler and more elegant solution, but I wasn't able to find one when I had this problem.


9

I made a script that uses multiple ways to check internet connection (ping, nc, and curl, thanks to Adam Katz, Gilles, and Archemar). I hope someone finds this useful. Feel free to edit it to your liking/optimize it. Checks your gateway, DNS, and internet connection (using curl, nc, and ping). Put this in a file then make it executable (Usually sudo chmod +...


9

I solve the problem by using Amrish instructions at Ask Ubuntu Stack Exchange, i.e. by using the following code: sudo rm /etc/resolv.conf sudo ln -s ../run/resolvconf/resolv.conf /etc/resolv.conf sudo resolvconf -u


8

From your output, you are not able to reach the destination. The * denotes a timeout. traceroute command shows the path to your destination. packets send to will pass through the routers and you receive a response obeying the time to live (TTL) value for each packets. the * denotes a timeout as a response from the intermediate routers that says the packet ...


8

Uses the same antenna. Currently most software doesn't allow to be in client and AP mode at the same time. Wireless is a half-duplex protocol, except for some really new bleeding edge stuff. The radio can only transmit or receive at one time, it cannot do both at the same time. Going with point 3, if any software was developed to allow both client and AP ...


8

If you just see Loopback interface with ifconfig command Then issue ifconfig -a This will list all of your adapters on VM OS. Lets assume that you have eth0 as your primary adapter, then simply write following command: ifup eth0 After interface goes up, you'll be able to see it listed in ifconfig output and you should be able to ping outside world.


8

Outgoing ICMP (ping) is probably blocked by your firewall or gateway. That you are able to browse the Internet does not need ICMP (ping) to be working. You also might have a proxy configured which allows you to only surf the web.


7

This is definitely feasible. Many of us were running mixed, load-balanced broadband configs for corporate years ago and they worked really well. Many probably still do! You can do it in a number of ways, including using iptables rules and/or iproute2 (ip(8) command) to setup policy routing. The load balancing is not done at the packet level, but at the ...


7

They're in the $http_proxy, $https_proxy and $ftp_proxy environment variables. Also, $no_proxy contains a comma-separated list of host patterns for which no proxy is used. For example: http_proxy=http://proxy.example.com:3128/ no_proxy=localhost,127.0.0.1,*.example.com


7

ipinfo.io has nice JSON API for using from command line: $ curl ipinfo.io { "ip": "X.X.X.X", "hostname": "No Hostname", "city": "Hanoi", "region": "Ha Noi", "country": "VN", "loc": "21.0333,105.8500", "org": "AS18403 The Corporation for Financing & Promoting Technology" }


7

I just ran into the same problem. Solution turned out simple: systemctl start dhcpcd.service Everything (ping, pacman, etc.) started working after that. BTW: # systemctl enable dhcpcd@enp3s0.service has a typo. Should be enp0s3. Explains your No such file or directory error ;)


7

The guidance on the Wireshark documentation suggests capturing the entire contents of the packet using this command: $ tcpdump -i <interface> -s 65535 -w <some-file> Looking at the man page for tcpdump the guidance there suggests that -s0 should be equivalent: -s Snarf snaplen bytes of data from each packet rather than the default of ...


7

SOLVED this issue on for myself on my macbook running Kali Linux. Go back into the network settings on virtual box, make sure it says 'Nat' and below that click advanced settings. Make sure "cable connected" is selected and start up your Kali Linux! Bam, you know have internet.


6

I'd highly recommend you use RSA keys rather than passwords for remote SSH logons. Second, you'll want to install Fail2Ban or something similar to discourage brute force breakin attempts (although again, disabling password authentication in favor of RSA public/private key authentication for SSH access would make this a mostly moot point) Third, it's ...


6

it is very possible to use hotspot and browse the internet with the same wifi card at the same time (simultaneously).i have been using it for sometime now.ideapad 100s 141br with card intel dualband 3160,ubuntu. the most simplest way i found was to use an app called create_ap in github. it works perfectly. first you need these installed; util-linux, bash, ...


6

Something like this could work for you: curl -sIkL http://repo1/xyz/LATEST | sed -r '/filename=/!d;s/.*filename=(.*)$/\1/' Take a look at man page curl(1) for the options. The interesting one is -I, --head. Explanation as requested per comments: The idea is to request the HTTP response header only. Therefore the -I options is used. -s silents curl to ...


6

Spoofing your MAC-Address is relatively simple: General steps: Save your MAC for a future reset Temporary disable your interface to change your MAC Set your new, arbirtray MAC Enable your interface again Using different tools: With ip: ip link show <interface> &> ip_savehafen.log sudo ip link set dev <interface> down sudo ip link set ...


Only top voted, non community-wiki answers of a minimum length are eligible