$ /sbin/ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:12:43:A6:05:5C inet addr:193.144.84.77 Bcast:193.144.84.255 Mask:255.255.255.0 inet6 addr: fe80::211:43ff:fea6:55c/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1035446 errors:0 dropped:0 overruns:0 frame:0 TX packets:1053062 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:196973192 (187.8 MiB) TX bytes:270128587 (257.6 MiB) Interrupt:169
ifconfig [opciones] [interfaz]
ifconfig interfaz [configuración] [up|down]
# ifconfig eth0 193.144.84.77 netmask 255.255.255.0 broadcast 193.144.84.255 up
# ifconfig eth0 mtu 500
# ifconfig eth0 -noarp
# ifconfig eth0 hw ether 52:54:00:12:34:56
Otros comandos de configuración de interfaz son:
# ifdown eth0
# iwconfig eth1 essid "Mi Red"
$ /sbin/route -n -ee Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface MSS Window irtt 193.144.84.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0 0 0 0.0.0.0 193.144.84.1 0.0.0.0 UG 0 0 0 eth0 0 0 0
route [add|del] [default] [-net|-host] target [netmask Nm] [gw Gw] [opciones] [[dev] If]Ejemplo: suponer que tenemos la configuración del dibujo, y queremos crear la tabla de rutas para el host Internet
route add default gw 10.0.2.2
# echo 1 > /proc/sys/net/ipv4/ip_forward
netstat [tipo de información] [opciones]
$ netstat Active Internet connections (w/o servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 jumilla.dec.usc.e:58946 aiff.usc.es:telnet ESTABLISHED tcp 0 0 jumilla.dec.usc.e:43658 ulla.dec.usc.es:1301 ESTABLISHED tcp 0 0 jumilla.dec.usc.e:35346 sd.cesga.es:ssh ESTABLISHED tcp 0 0 jumilla.dec.usc.es:ssh ulla.dec.usc.es:1688 ESTABLISHED tcp 0 0 jumilla.dec.usc.es:ssh teneguia.dec.usc.:35161 ESTABLISHED Active UNIX domain sockets (w/o servers) Proto RefCnt Flags Type State I-Node Path unix 8 [ ] DGRAM 15368 /dev/log unix 2 [ ] DGRAM 194110 @/org/kernel/udev/udevd unix 2 [ ] DGRAM 15671 @/var/run/hal/hotplug_socket
$ netstat -i Kernel Interface table Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg eth0 1500 0 5110292 0 0 0 5011769 0 0 0 BMRU
# ifconfig eth0 promisc # Modo promiscuo
# ifconfig eth0 -arp # Desactiva ARP
$ netstat -s Ip: 5001746 total packets received 7479 forwarded 0 incoming packets discarded 4894721 incoming packets delivered ......
# arp Address HWtype HWaddress Flags Mask Iface almansa.dec.usc.es ether 00:0D:56:6F:E6:90 C eth0 193.144.84.1 ether 00:E0:63:93:26:E5 C eth0 teneguia.dec.usc.es ether 00:C0:4F:A1:5D:89 C eth0
$ ping 193.144.84.1 PING 193.144.84.1 (193.144.84.1) 56(84) bytes of data. 64 bytes from 193.144.84.1: icmp_seq=1 ttl=255 time=0.420 ms 64 bytes from 193.144.84.1: icmp_seq=2 ttl=255 time=0.396 ms 64 bytes from 193.144.84.1: icmp_seq=3 ttl=255 time=0.368 ms
$ traceroute www.elpais.es traceroute to a1749.g.akamai.net (130.206.192.32), 30 hops max, 40 byte packets 1 rutfis (193.144.64.1) 1.070 ms 0.688 ms 0.927 ms 2 * * * 3 10.56.5.1 (10.56.5.1) 57.463 ms 2.021 ms 1.923 ms 4 193.144.79.72 (193.144.79.72) 2.507 ms 16.280 ms 2.080 ms 5 GE2-0-0.EB-Santiago0.red.rediris.es (130.206.204.21) 25.681 ms 2.068 ms 1.965 ms 6 GAL.SO2-0-0.EB-IRIS4.red.rediris.es (130.206.240.33) 10.959 ms 10.665 ms 10.710 ms 7 130.206.220.59 (130.206.220.59) 20.277 ms 10.781 ms 10.470 ms 8 a130-206-192-32.deploy.akamaitechnologies.com (130.206.192.32) 11.011 ms 23.482 ms 12.185 ms
$ host www.elpais.es www.elpais.es is an alias for elpais.es.edgesuite.net. elpais.es.edgesuite.net is an alias for a1749.g.akamai.net. a1749.g.akamai.net has address 130.206.192.38 a1749.g.akamai.net has address 130.206.192.32
# mii-tool -v eth0 eth0: negotiated 100baseTx-FD flow-control, link ok product info: vendor 00:08:18, model 16 rev 0 basic mode: autonegotiation enabled basic status: autonegotiation complete, link ok capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control # mii-tool --force=100baseTx-HD eth0 # mii-tool eth0 eth0: 100 Mbit, half duplex, link ok
Administración de Sistemas e Redes <ASR.USC[at]gmail.com>
Tomás Fernández Pena <tf.pena[at]usc.es>
Última actualización: 19-10-15 11:23 por tomas
Curso de Administración de Sistemas y Redes por Tomás Fernández Pena se distribuye bajo la licencia Creative Commons Recoñecemento-Compartir baixo a mesma licenza. 3.0 España.
Trabajo original en persoal.citius.usc.es/tf.pena/ASR.