Aller au contenu

Networking#

Test Commands#

Bash
1
2
3
# IP Tests 5x
ping -c 5 192.168.77.7
ping -c 5 www.amazon.com

Get Network informations or Tests#

Bash
# Get the list of interfaces
ip a

# Getting routing information
route -n

# List All Open Ports
netstat -tulpn | grep LISTEN

# List All Active Port 22 in subnet
nmap -p22 192.168.25.0/24

# Scan (with ping) all ip in a subnet
nmap -sn 192.168.77.0/24

# Get ethernet card speed
cat /sys/class/net/<interface>/speed
nc example usage

DNS#

Bash
1
2
3
4
5
# List DNS TXT entries
host -t txt o7conseils.com

#
dig CNAME o7conseils.com

Remote connection#

Bash
# Log in remote shell
ssh user@192.168.99.101

Get File or Web Sites#

Bash
# Get a file from a http address
wget

# Execute GET (or POST... see help)
curl [URL]


# GET web page with all the communication details and hostname
curl -v --max-time 5 https://o7conseils.com

# GET web page with all the communication details, hostname, and a 5-second timeout
curl -v --header "Host: o7conseils.com" --max-time 5 https://o7conseils.com

# Without certificate validation
curl -v -k --max-time 5 https://o7conseils.com

To add IP to your local Host file#

/etc/hosts
1
2
3
4
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost6 localhost6.localdomain6

10.10.0.123 myserver.myhost.com