Condense de commandes

  • Condense de commandes
#---
#--- dhclient - Dynamic Host Configuration Protocol Client
#---
linux@linux:~$ sudo dhclient3 -e IF_METRIC=100 -pf /var/run/dhclient.eth0.pid -lf /var/lib/dhcp3/dhclient.eth0.leases eth0

#---
#----Affiche, configure une interface réseau------------------
#---
linux@linux:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 10:44:78:87:49:27  
          inet adr:192.168.0.5  Bcast:192.168.0.255  Masque:255.255.255.0
          adr inet6: fe80::204:75ff:fe87:4927/64 Scope:Lien
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Packets reçus:13 erreurs:0 :0 overruns:0 frame:0
          TX packets:37 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:1000 
          Octets reçus:2368 (2.3 KB) Octets transmis:5261 (5.2 KB)
          Interruption:19 Adresse de base:0xac00 

eth1      Link encap:Ethernet  HWaddr 10:1b:21:3c:68:70  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          Packets reçus:0 erreurs:0 :0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:1000 
          Octets reçus:0 (0.0 B) Octets transmis:0 (0.0 B)
          Interruption:20 Adresse de base:0xe800 

lo        Link encap:Boucle locale  
          inet adr:127.0.0.1  Masque:255.0.0.0
          adr inet6: ::1/128 Scope:Hôte
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          Packets reçus:12 erreurs:0 :0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:0 
          Octets reçus:720 (720.0 B) Octets transmis:720 (720.0 B)

#--
#----------------------------------------------------
#--
linux@linux:~/Commandes$ route -ne
Table de routage IP du noyau
Destination     Passerelle      Genmask         Indic   MSS Fenêtre irtt Iface
192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0
0.0.0.0         192.168.0.254   0.0.0.0         UG        0 0          0 eth0

linux@linux:~/Commandes$ route -e
Table de routage IP du noyau
Destination     Passerelle      Genmask         Indic   MSS Fenêtre irtt Iface
192.168.0.0     *               255.255.255.0   U         0 0          0 eth0
link-local      *               255.255.0.0     U         0 0          0 eth0
default         192.168.0.254   0.0.0.0         UG        0 0          0 eth0


#--
#----------------------------------------------------
#--
 sudo ifconfig etho down
 sudo ifconfig eth0 down
 sudo /etc/init.d/networking force-reload
 ifconfig
 sudo lshw -C network -numeric
 ifconfig
 route -n
 ifconfig

#--
#----------------------------------------------------
#--
 sudo ifconfig
 sudo ifconfig eth0 down
 sudo ifconfig eth0 up

#--
#----------------------------------------------------
#--
 pg /etc/network/interfaces
 auto lo
 iface lo inet loopback
 auto eth1
 iface eth1 inet dhcp

#--
#----------------------------------------------------
#--
/etc/sysctl.d/10-network-security.conf

#--
#----------------------------------------------------
#--
iwconfig


#--
#----------------------------------------------------
#--
cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 212.27.40.240
nameserver 212.27.40.241

#--
#----------------------------------------------------
#--
route -n
Table de routage IP du noyau
Destination     Passerelle      Genmask         Indic Metric Ref    Use Iface
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0

#--
#----------------------------------------------------
#--
pg /etc/udev/rules.d/70-persistent-net.rules
# This file maintains persistent names for network interfaces.
# See udev(7) for syntax.
#
# Entries are automatically added by the 75-persistent-net-generator.rules
# file; however you are also free to add your own entries.

# PCI device 0x10ec:0x8139 (8139too)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:19:21:3c:86:60", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x10b7:0x9200 (3c59x)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:04:75:87:49:27", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"


#--
#----------------------------------------------------
#--
linux@linux:~/Commandes$ pg /etc/dhcp3/dhclient.conf
# Configuration file for /sbin/dhclient, which is included in Debian's
#	dhcp3-client package.
#
#------------- Ajout Linux avant en commentaire
alias {
  interface "eth0";
  fixed-address 192.168.0.5;
  option subnet-mask 255.255.255.0;
}



#--
#-------------------------------------------------------------
#--

linux@linux:~/Commandes$ sudo depmod -a

linux@linux:~/Commandes$ sudo ls -ltr /lib/modules/2.6.32-24-generic/modules*
-rw-r--r-- 1 root root 104529 2010-08-20 20:22 /lib/modules/2.6.32-24-generic/modules.order
-rw-r--r-- 1 root root   5084 2010-08-20 20:22 /lib/modules/2.6.32-24-generic/modules.builtin
-rw-r--r-- 1 root root 839848 2012-10-07 07:09 /lib/modules/2.6.32-24-generic/modules.usbmap
-rw-r--r-- 1 root root 295361 2012-10-07 07:09 /lib/modules/2.6.32-24-generic/modules.symbols.bin
-rw-r--r-- 1 root root 228851 2012-10-07 07:09 /lib/modules/2.6.32-24-generic/modules.symbols
-rw-r--r-- 1 root root   1597 2012-10-07 07:09 /lib/modules/2.6.32-24-generic/modules.seriomap
-rw-r--r-- 1 root root 403957 2012-10-07 07:09 /lib/modules/2.6.32-24-generic/modules.pcimap
-rw-r--r-- 1 root root     74 2012-10-07 07:09 /lib/modules/2.6.32-24-generic/modules.ofmap
-rw-r--r-- 1 root root  24886 2012-10-07 07:09 /lib/modules/2.6.32-24-generic/modules.isapnpmap
-rw-r--r-- 1 root root    218 2012-10-07 07:09 /lib/modules/2.6.32-24-generic/modules.inputmap
-rw-r--r-- 1 root root   1405 2012-10-07 07:09 /lib/modules/2.6.32-24-generic/modules.ieee1394map
-rw-r--r-- 1 root root 397652 2012-10-07 07:09 /lib/modules/2.6.32-24-generic/modules.dep.bin
-rw-r--r-- 1 root root 269549 2012-10-07 07:09 /lib/modules/2.6.32-24-generic/modules.dep
-rw-r--r-- 1 root root     69 2012-10-07 07:09 /lib/modules/2.6.32-24-generic/modules.ccwmap
-rw-r--r-- 1 root root   6363 2012-10-07 07:09 /lib/modules/2.6.32-24-generic/modules.builtin.bin
-rw-r--r-- 1 root root 569737 2012-10-07 07:09 /lib/modules/2.6.32-24-generic/modules.alias.bin
-rw-r--r-- 1 root root 590022 2012-10-07 07:09 /lib/modules/2.6.32-24-generic/modules.alias



#--
#---show / manipulate routing, devices, policy routing and tunnels
#--

linux@linux:~/Commandes$ sudo ip addr show eth0
3: eth0:  mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
    link/ether 00:04:75:87:49:27 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::204:75ff:fe87:4927/64 scope link 
       valid_lft forever preferred_lft forever

##find and kill any dhcp clients looking on eth.
 sudo ip a flush dev eth0

##then add your address info
 sudo ip a a dev eth0 192.168.0.1/5

##route show
 sudo ip route show



#--
#--------------------------------------------
#--
linux@linux:~$ pg /etc/sysctl.d/10-network-security.conf

# Turn on Source Address Verification in all interfaces to
# prevent some spoofing attacks.
net.ipv4.conf.default.rp_filter=1
net.ipv4.conf.all.rp_filter=1

# Turn on SYN-flood protections.  Starting with 2.6.26, there is no loss
# of TCP functionality/features under normal conditions.  When flood
# protections kick in under high unanswered-SYN load, the system
# should remain more stable, with a trade off of some loss of TCP
# functionality/features (e.g. TCP Window scaling).
net.ipv4.tcp_syncookies=1

#---- ajout
net.ipv6.binv6only=0


#--
#--view, manipulate media-independent interface status
#--
sudo mii-tool


#--
#-- Renouveler bail DHCP
#--

## ipconfig /renew
## Sous Linux la commande ifconfig
## Mais pour le renew il faut utiliser dhclient

## Liberer l’adresse IP courante
sudo dhclient -r

## recuperer une nouvelle adresse IP ou la même
sudo dhclient

Previous page: Snmp
Page suivante : FireSSH