network_commands
Table of Contents
If you want to send us your comments, please do so. Thanks
More on comments
Network commands
General considerations
We find these commands hard to work with, if they even work
This needs more study and trial and error testing
Show your IP
If you have access to a webserver you can run your own “show IP” service
- vi showip.php
- Add
<?php echo $_SERVER['REMOTE_ADDR']; ?>
to it
- Save the file
- Upload showip.php to your webserver
- In a browser open http://yourwebserver.tld/showip.php. On our server: https://webevaluation.nl/showip.php
General commands
Command | Description | Remark |
---|---|---|
adnshost | A general-purpose DNS lookup utility | From the adns-tools package. Limited security support |
adnslogres | A logresolv program | From the adns-tools package. Limited security support |
adnsresfilter | A filter which copies its input to its output | From the adns-tools package. Limited security support |
iirc | ||
ip | show / manipulate routing, devices, policy routing and tunnels | |
ip2host | Resolve IP's to hostnames in webserver logs | |
iptstate | IPTables State Top. A top-like display of IP Tables state table entries | Interactive commands |
iptraf-ng | ncurses interactive colorful IP LAN monitor | |
lsm | Link connectivity monitor tool | |
ncat | Concatenate and redirect sockets | Part of nmap. Successor of netcat |
net-tools | Package containing arp, ifconfig, netstat, rarp, nameif and route | |
netcat | Concatenate and redirect sockets | Succeded by ncat |
netdiag | Package containing tcpblast, netload, trafshow, netwatch, statnet, tcpspray | |
netstat | Is replaced by ss | |
netstat-nat | Show the natted connections on a linux iptable firewall | |
NetworkManager | Network management daemon | |
nm-connection-editor | This starts the GTK window that can also be started from the system tray | |
nm-online | Ask NetworkManager whether the network is connected | Find the answer with echo $? 0: Online; 1: Offline; 2: Error |
nm-tool | Utility to report NetworkManager state and devices | Obsolete? |
nmcli | Command-line tool for controlling NetworkManager | Obsolete? |
nmtui | ncurses tool to manage network connections | |
ping | send ICMP ECHO_REQUEST to network hosts | ping -4 -c 1 -q -w 3 &> /dev/null Only IPv$, only one ping, almost no output, quit after 3 seconds when no reply and discard all output. Useful in a script |
sntop | top-like console network status tool | Shows if a website is up. In alarm or log mode a file is executed on the occurence of change in status of a given host |
ss | Another utility to investigate sockets | Replaces netstat which is deprecated. ss is part of the iproute2 package |
systemctl restart networking | ||
systemctl status network |
Programs in the iproute2 package
Command | Description | Remark |
---|---|---|
arpd | ||
iputils-arping | ARP ping | |
bridge | ||
ctstat | ||
devlink | ||
ip | ||
lnstat | ||
nstat | ||
routef | ||
routel | ||
rtacct | ||
rtmon | ||
rtstat | ||
ss | ||
tc | ||
tipc |
Interfaces
Command | Description | Remark |
---|---|---|
dhclient | Dynamic Host Configuration Protocol Client | General |
ifdown | ||
ifup | ||
ifquery | ||
ifconfig | configure a network interface | General |
Wireless LAN
Command | Description | Remark |
---|---|---|
iw | show / manipulate wireless devices and their configuration | WiFi |
iwconfig | Deprecated and replaced by iw | |
iwlist | Get more detailed wireless information from a wireless interface | WiFi |
Examples
Command | Remark |
---|---|
dhclient wlan0 | |
nmcli dev wifi | |
iwlist wlan0 scan | grep -i ssid | |
iw dev wlan0 scan | grep SSID | |
ifconfig wlan0 up | |
ifdown eth0; ifup eth0 | |
ip addr | Show information for all addresses. Shows IP numbers of the host |
ip link show wlan0 | |
ip link show enp7s0 | |
ip route | Show the routingtable and thereby the IP address of the router the host is connected to |
ip set link eth0 down | Bring link eth0 down |
ip set link eth0 up | Bring link eth0 up |
iw wlan0 link | |
iw dev wlan0 station dump | iw dev wlan0 station dump Does the same |
iw wlan0 disconnect | Disconnects and reconnects automatically again |
nmcli dev wifi connect SSID password SSID_pawssword | Does not work at this moment |
nmcli general | Output: STATE CONNECTIVITY WIFI-HW WIFI WWAN-HW WWAN connected full enabled enabled enabled enabled |
ifconfig wlan0 down | |
ifconfig wlan0 up | |
ifconfig -v eth0 192.168.1.6 | Assing IP address 192.168.1.6 to network interface eth0 and bring it up |
File locations
File | Function |
---|---|
/etc/networks | Holds the local network addresses |
/etc/network/interfaces | available network interfaces |
/etc/dhcp/dhclient.conf | Configuration file for /sbin/dhclient |
/etc/host.conf | |
/etc/hostname | Holds the hostname of the computer |
/etc/hosts | Holds the hostlist. See also hosts.allow hosts.deny |
/etc/resolv.conf | DNS servers |
/etc/NetworkManager/NetworkManager.conf |
Useful links
iw documentation
Network Configuration
Debian static IP address
How to connect to a WPA/WPA2 WiFi network using Linux command line
Main subjects on this wiki: Linux, Debian, HTML, Microcontrollers, Privacy
RSS
Disclaimer
Privacy statement
Bugs statement
Cookies
Copyright © : 2014 - 2023 Webevaluation.nl and the authors
Changes reserved.
network_commands.txt · Last modified: 24-09-2023 09:19 by wim