Networking/shaare/F6ZbJQ
Interface configuration files:
-
/etc/nsswitch.conf→ where resolve hostname to IP address -
/etc/hosts→ add new IP to resolve -
/etc/resolv.conf→ resolve hostname -
netstat→ what’s happening on the network -
tcpdump -inetworkinterface (wifi, wlp2s0)- network sniffing
NIC → network interface card
lo→ loopback (local machine)virbr0→ virtual bridge
ETHTOOL ENP0S3
- Speed? / Duplex?
-
Link detected:
- YES → network is working
- NO → not working
NIC BONDING
-
Combine 2 NIC (ethernet port)
- For redundancy
- High availability
- Link aggregation → 1G + 1G = 2G
-
modprobe bonding
-
Create a bond interface file:
nano /etc/sysconfig/network-scripts/ifcfg-bond0
-
Create first NIC file →
ifcfg-enp0s3- Add MAC, IP, etc.
- Create second NIC file →
ifcfg-enp0s8 systemctl restart network
cat /proc/net/bonding/bond0 → show bond interface settings
Network utilities
nmcli→ network manager command line interfacenmtui→ network manager text user interfacenm-connection-editor→ GUI for most of the network managernmtui→ team (to create bond)
-
nmcli device→ listing of interface -
nmcli connection modify enp0s3 ipv4.addresses 192.168.0.180/24 -
nmcli connection modify enp0s3 ipv4.gateway 192.168.0.1 -
nmcli connection modify enp0s3 ipv4.method manual
NMCLI -
nmcli connection down enp0s3 -
nmcli connection up enp0s3 -
ip address show enp0s3
Download File
wget http://mydomain.com/soft.deb
Find Out Page (Website) is Up
curl http://website.com/curl -O http://web.com/file→ download a fileping→ get IP responsenslookup→ info sur le site
SS
-
Check how device talk to the internet
- Identify problem
Socket
-
Enable data transmission
- TCP, UDP, UNIX
TCP (Transmission Control Protocol)
- Rule: data is sent successfully (HTTP, FTP, SMTP)
UDP (User Datagram Protocol)
- Sending data without checking if it arrives correctly
- Video streaming
UNIX
- Way for programs to talk to each other
- Use a special file for message exchange
- Database / webservers / local system
SS Options
ss -t→ show TCP connectionss -u→ show UDP connectionss -x→ show UNIX connectionss -l→ listening socketsss -n→ display addresses in numerical form
(97)