Skip to content

Instantly share code, notes, and snippets.

@Iduoad
Created December 24, 2018 17:34
Show Gist options
  • Save Iduoad/69aafcd996b999f72eaf7f54ba55aacd to your computer and use it in GitHub Desktop.
Save Iduoad/69aafcd996b999f72eaf7f54ba55aacd to your computer and use it in GitHub Desktop.
Correction du tp8 Linux
# 1. interfaces reseaux
ip link show #(ip link toute seule)
# 2. network manager
# 2.1
systemctl status networkmanager.service
# 2.2
ip link show eth0 | grep state | cut -f9 -d" " #remplacez eth0 par le nom de la carte reseau.
ip link show up
# 3. adresses
ip addr
# 4. configuration
ip adrr show eth0 | tail -n 4 > conf.txt
# 5.
# Modifier le BOOTPROT avec static, ajouter les configurations sur le fichier conf.txt par exemple
# IPADDR(adresse ip), NETMASK(le masque), GATEWAY(adresse de la passerelle), HWADRR(Adresse MAC)
# voir page 17 cours
nano /etc/sysconfig/network-scripts/ifcfg-eth0
# parametres generals voir page 18 cours
nano /etc/sysconfig/network
# parametres DNS
nano /etc/resolv.conf
#6.
sytemctl reload NetworkManager.service
#7.
ip link set eth0 up
# III.
# 1.
ping -c 5 192.168.1.104
ping -c 5 192.168.1.1
ping -c 5 8.8.8.8
ping -c 5 localhost
# 2.
ping -c 5 192.168.1.105 &> /dev/null || echo "error"
# 3.
traceroute 8.8.8.8 #affichage de noms de hotes
traceroute -q 1 -n 8.8.8.8 #affichage des adresses ip instead of nom de hote (-n) + affichage d'une machine par hop/reseaux (-q1)
# 4.
netstat -a | grep 'dhclient\|rpcbind\|dnsmasq'
# IV.
#1.
systmctl status sshd.service || systemctl restart sshd.service
#2.
ssh -l login -v 192.127.1.177
#3.
nano /etc/ssh/sshd_config #PermitRootLogin no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment