NAT traversal y Wake on lan

De Portfolio Academico

NAT traversal

NAT traversal es un término aplicado a las técnicas que establecen y mantienen conexiones en redes utilizando los protocolos TCP/IP o UDP que atraviesan (NAT) gateways.

Las técnicas de NAT traversal suelen ser requeridas por aplicaciones cliente-cliente, especialmente las peer-to-peer y Voip. Existen diversas técnicas, pero ninguna de ellas funciona en cualquiera de las situaciones debido a que el comportamiento del NAT no está estandarizado. Algunas de las técnicas necesitan de un servidor con dirección IP pública encaminable, otras solo necesitan el servidor cuando establecen la conexión, y otras están basadas en transmitir todos los datos a través de él, que aumenta el gasto de ancho de banda y la latencia, en detrimento de las comunicaciones de voz y video en tiempo real.

Wake on lan y wan

Wake on Lan/Wan, es una tecnología mediante la cual podemos encender un ordenador de manera remota, simplemente mediante una llamada de software. Puede implementarse tanto en redes locales (LAN), como en redes de área extensa (WAN o Internet).

Al implementarlo en LAN, enviaremos un paquete a la direccion de broadcast de nuestra red. Este paquete contiene una cadena de 6 bytes de valor 255 ("FF FF FF FF FF FF" en hexadecimal), seguida de 16 repeticiones de la dirección MAC del computador de destino. Al enviarlo a la direccion de broadcast, hacemos que todos los ordenadores conectados por cable a la red lo reciban. El que tenga la tarjeta de red con la mac que se envia, se encenderá. Es necesario que el hardware soporte Wake on Lan.

Para hacerlo mediante internet...

To remotely wake up a computer over the Internet using Wake On LAN- follow these instructions:

1 - Create a port forward rule on the Web Interface (Applications & Gaming -> Port Range Forward) to the chosen ip:

wol  |  9  |  9  |  udp  |  192.168.1.254  |  x

Here, 9 is the default, but you can use any port number so long as your client wake-up application can talk to a port other than 9. Most WOL services will use either UDP port 7 or 9.

192.168.1.254 is just an IP address in your LAN's subnet; it can be any IP, as long as it is not assigned to any device on your network.

2 - Add a static ARP entry by typing the following line into the Administration -> Commands section of the Web Interface and then saving with Save Startup.

arp -i br0 -s 192.168.1.254 FF:FF:FF:FF:FF:FF

Do not change the FF:FF:FF:FF:FF:FF MAC address; this is a special MAC address used when broadcasting. WOL magic packets are constructed using the MAC address of the target computer, but should be and almost always are sent via broadcast; the MAC address used here controls with how the packet is sent, not how it is formed.

The 192.168.1.254 IP address should correspond with the IP address you used in the previous step. Again, this IP should be in your LAN's subnet, and you must not assign this IP address to any actual device on your network.

Explanation/rationale for this setup: Normally, WOL magic packets are sent to a special broadcast IP--to the final .255 in a subnet or to 255.255.255.255. Since port-forwarding to these special dedicated broadcast IPs does not work, what we need to do is create our own broadcast IP by taking an unused IP and assigning it a broadcast MAC and then port-forward to that.

Host Name: DynDNS name of your DD-WRT device. Subnet Mask: 255.255.255.255 MAC Address: WOL computer MAC address, not the DD-WRT MAC. Click the green Send button.