Archive for the 'redes' Category

 

error resolving source: libnet_get_ipaddr4(): ioctl(): Cannot assign requested address

Nov 23, 2009 in Debian, linux, redes

Traceando protocolo aparece este error :

traceproto -p tcp 192.168.1.1
error resolving source: libnet_get_ipaddr4(): ioctl(): Cannot assign requested address

Es debido a que no hay ip o que no hemos especificado el interface que debe tracear. Por defecto elige el primer interface disponible.

En mi caso saliendo por wifi habría que definir el trace por ‘wlan0′

# traceproto -p tcp -F wlan0 192.168.1.1
traceproto: trace to 192.168.1.1 (192.168.1.1), port 80
using interface wlan0
ttl  1:  TCP Syn Ack from 192.168.1.1 (192.168.1.1)
	8.3820 ms	0.95900 ms	0.72100 ms

hop :  min   /  ave   /  max   :  # packets  :  # lost
-------------------------------------------------------
  1 : 0.72100 / 3.3540 / 8.3820 :   3 packets :   0 lost
------------------------Total--------------------------
total 0.72100 / 2.5155 / 8.3820 :   3 packets :   0 lost

Colisiones

May 19, 2006 in Debian, redes

eth1 Link encap:Ethernet HWaddr 00:11:25:57:BC:69
inet addr:62.151.24.74 Bcast:62.151.24.79 Mask:255.255.255.240
inet6 addr: fe80::211:25ff:fe57:bc69/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:174549467 errors:0 dropped:0 overruns:0 frame:0
TX packets:190245054 errors:29876265 dropped:0 overruns:0 carrier:29876265
collisions:32648117 txqueuelen:1000
RX bytes:1089220947 (1.0 GiB) TX bytes:2670160874 (2.4 GiB)
Base address:0×4400 Memory:d0340000-d0360000

Las colisiones son _normales_ en redes CSMA/CD como Ethernet con lo que
la cantidad absoluta de colisiones no es un problema, siempre y cuando
no exceda el 3% de las transmisiones totales. Esto es, si

colisiones * 100 / ( transmisiones + colisiones ) <= 4

3264811700 / 222893171 = 14,6

como mucho debería ser 4

¿Podrías mirar si las tarjetas están generando muchas interrupciones? Puedes
saberlo con un cat /proc/interrupts:

ender@bonzo:~$ cat /proc/interrupts
CPU0
0: 145243168 XT-PIC timer
1: 658148 XT-PIC keyboard
2: 0 XT-PIC cascade
5: 12889488 XT-PIC soundblaster
8: 3 XT-PIC rtc
10: 2222796 XT-PIC usb-uhci
12: 6588303 XT-PIC eth0 <======= Este valor.
14: 1522717 XT-PIC ide0
15: 10359 XT-PIC ide1
NMI: 0
LOC: 145243899
ERR: 0
MIS: 0

¿Sube *a lo bestia* cuando haces una transferencia? Debería subir en uno por
cada paquete.

solucionado cuando han forzado el switch a full duplex
mii-tool –force 100baseTx-FD eth1

Colisiones en inteface eth1

referencias

http://linux-ip.net/html/tools-ethernet.html

~# netstat -in
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 1248529355 0 0 01238671872 0 0 0 BMRU
eth1 1500 0 304093570 0 0 0345828281 45713974 0 0 BMRU
lo 16436 0 3590482 0 0 0 3590482 0 0 0 LRU
lo:1 16436 0 – no statistics available – LRU

eth1 Link encap:Ethernet HWaddr 00:11:25:57:BC:69
inet addr:62.151.24.74 Bcast:62.151.24.79 Mask:255.255.255.240
inet6 addr: fe80::211:25ff:fe57:bc69/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:304226299 errors:0 dropped:0 overruns:0 frame:0
TX packets:346020913 errors:45713974 dropped:0 overruns:0 carrier:45713974
collisions:50035841 txqueuelen:1000
RX bytes:1487723678 (1.3 GiB) TX bytes:1302534086 (1.2 GiB)
Base address:0×4400 Memory:d0340000-d0360000

Cambiar de half-duplex a full-duplex

# mii-tool eth0
eth0: 10 Mbit, half duplex, link ok

Port Speed Description
10baseT-HD 10 megabit half duplex
10baseT-FD 10 megabit full duplex
100baseTx-HD 100 megabit half duplex
100baseTx-FD 100 megabit full duplex

~# mii-tool eth0
eth0: negotiated 100baseTx-FD, link ok

~# mii-tool -v
eth0: negotiated 100baseTx-FD, link ok
product info: vendor 00:aa:00, model 56 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
eth1: negotiated 100baseTx-FD, link ok
product info: vendor 00:aa:00, model 56 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

# mii-tool –force 100baseTx-FD
# mii-tool eth0
eth0: 100 Mbit, full duplex, link ok

tambien se puede forzar en los parametros de los modulos dependiendo de la tarjeta

http://www.cites.uiuc.edu/network/autosense.html

Cisco Catalyst Switches
Departmental Switches

On most multi-module Cisco switches, you can display the current port status with the command:

show port mod/port(s)

The Duplex and Speed columns of the table will tell you what the current port mode is set to. If the port has been forced to a specific mode, that mode will simply be listed. If the port is set to auto-negotiation, but nothing is plugged into it, the speed and duplex will be reported as auto. If the current mode was the result of a successful auto-negotiation, the labels will be prefixed with “a-” (e.g. a-100 or a-full). To change the mode of a port, you can use the following commands:

set port speed mod/port(s) mode, with mode being either 10, 100, or auto.
set port duplex mod/port(s) mode, with mode being either full or half.

If a port has its speed mode set to auto, the duplex mode will also be set to auto and you will not be able to change it. In order to change the duplex mode, you will need to set the speed mode to 10 or 100. For more information, see the Cisco Catalyst 5000 series Ethernet/Fast Ethernet Module manual.

If you are depending on auto-negotiation, please be sure that portfast is configured on, and etherchannel should be set to off.

tcpdump

May 19, 2006 in Notas rápidas, redes

Para ver si llegan datos de la ip 192.168.1.100 al puerto 80

tcpdump -i eth0 host 192.168.1.100 and port 80

Subneting

May 19, 2006 in redes

subneting

ip -> xxx.xxx.xxx.xxx -> 4 octetos (0-254) -> 4 x 8 = 32 bits

clase a
10.0.0.0 – 10.255.255.255
máscara /8

clase b
172.16.0.0 – 172.31.255.255
máscara /12

clase c
192.168.0.0 – 192.168.255.255
máscara /16

172.30.50.80/255.255.255.240

255.255.255 -> 11111111 111111111 11111111-> 24 bits
ahora más el ultimo

240 -> 11110000 -> 4 bits fijos y 4 libres

24 + 4 -> 28 bits

entonces 255.255.255.240 es lo mismo que /28

con 4 bits podemos representar 2^4 = 16 ips