Breve prueba de VNC Inversa, documentada

Esta es una nota rápida para documentar una prueba de conexion VNC inversa (Reverse VNC).

A diferencia de una conexión regular de VNC, en la cual te conectas a la PC a controlar, en una conexión inversa de VNC, la PC a controlar se conecta a ti. El control es en la misma dirección pero la conexión está invertida.

El beneficio? No tener que preocuparse sobre el estado de red ni direcciones de la PC remota. Suele ser más fácil iniciar conexiones que recibirlas. Así, quien tiene mejor conocimiento de redes será el que escuche y el alma en pena será el iniciador. Esto mueve las preocupaciones de red al «escuchante» del socket, justo donde deben estar en este caso en particular. Además, con el estado actual de IPv4 lleno de NAT, el mal necesario, no habrá que preocuparnos sobre la configuración de NAT / port forward en el router remoto.

Conformación de la prueba

La prueba se conforma de mi estación de trabajo de escritorio corriendo Ubuntu y mi laptop corriendo Windows, ambas en el mismo dominio de broadcast de Ethernet. No se toca gateway alguno en la prueba.

Nota: la prueba se realizó con software en inglés, de la cual traduje al español. La traducción podría no ser exacta en comparación con la versión en español del software.

Las características de mi estación de trabajo:

  • Sistema operativo: Ubuntu Lucid Lynx (10.04).
  • Paquete de VNC: xvnc4viewer 4.1.1+xorg4.3.0-37ubuntu2.
  • Rol: Computadora de control (cliente VNC). En un caso real aquí es donde yo estaría sentado y controlando computadoras remotas.
  • Dirección IP: 192.0.2.10 (esta dirección es falsa, para documentación según RFC 5735).

Características de la laptop:

  • Sistema operativo: Microsoft Windows XP SP3.
  • Paquete VNC: TightVNC 1.3.10, instalado de la colección OpenDisc.
  • Rol: PC a ser controlada (servidor VNC). En la vida real, esta sería la PC que recibiría soporte técnico por mí..
  • Dirección IP: 192.0.2.20 (esta dirección es falsa, para documentación según RFC 5735).

Pasos realizados para establecer la conexión

En la estación de trabajo (el cliente VNC, computadora de control):

  • Abrí una terminal
  • Ejecuté vncviewer -listen
  • Se debe recibir un mensaje como «main: Listening on port 5500» («escuchando en puerto 5500»)

En la laptop (el servidor VNC, la computadora a ser controlada):

  • Me fui a Inicio » Todos los programas » TightVNC y ejecuté Lanzar Servicio de TightVNC
  • Si aparece la ventana Propiedades, deshabilitar «Aceptar conexiones» y hacer click en OK (sólo por seguridad).
  • Click derecho en el icono de Servidor TightVNC en la bandeja de sistema y escoger Agregar nuevo cliente…
  • Ingresar la dirección IP de la estación de trabajo, en este ejemplo, 192.0.2.10 y hacer clic en OK o presionar Enter.

Notas

  • La prueba fue realizada con el Firewall de Windows habilitado. Podrías recibir un mensaje como Para ayudar a proteger tu equipo, el Firewall de Windows bloqueó algunas de las características de este programa. | El administrador del equipo podría ayudar a desbloquear el siguiente programa: TightVNC Win32 Server cuando al correr el Servidor TightVNC. Se le puede dar simplemente «Aceptar» puesto que esa PC será la que inicie y no la que escuche. Este mensaje se inhibe al deshabilitar Aceptar conexiones en la ventana Propiedades del Servidor TightVNC.
  • La prueba fue repetida usando una cuenta restringida de Windows con resultados satisfactorios. Esto te da gran flexibilidad. Podrías hasta hacer una versión portátil del servidor de TightVNC siguiendo el paso de las instrucciones en esse documento sobre VNC en el blog TinyApps.Org
  • Dependiendo del ancho de banda y latencia disponibles, podría ser necesario ajustar el servidor en la ventana de propiedades.
  • Noté una demora algo larga durante el primer intento de conexión, incluso llegando a fallar. En el segundo intento funcionó bien. Quiero suponer que tiene que ver con demoras de resolución de DNS y el caché, pero eso es mera especulación.

Se aceptan comentarios. Si conoces instrucciones para este mismo escenario usando otra plataforma, publícalo en tu blog y enlázalo desde un comentario aquí, o escríbelo directamente en un comentario.

Quick Reverse VNC test, documented

This is a quick note, documenting a quick successful test on Reverse VNC connections.

Unlike regular VNC connections, in which you connect to the controllable PC, in a Reverse VNC connection the controllable PC will connect to you. The control is in the same direction, but the connection is reversed.

What’s the benefit? Not having to worry about the network status and addresses of the remote PC. It is usually easier to initiate connections than to receive. This lets the guy with better network understanding to be the listener and the poor soul to be the initiator. This will put the network worries near to the tech support guy, where it should be for this particular scenario. Also, as with the current state of IPv4, full of the evil but necessary NAT, you will not have to worry about router NAT / port forwarding configuration in the remote router.

Test setup

The test setup consisted on my desktop workstation running Ubuntu and my laptop running Windows, both on the same Ethernet broadcast domain. No gateway was involved in the test.

The desktop workstation had the following characteristics:

  • Operating System: Ubuntu Lucid Lynx (10.04).
  • VNC package: xvnc4viewer 4.1.1+xorg4.3.0-37ubuntu2.
  • Role: Controlling computer (VNC client). In real life here is where I would sit and control other computers.
  • IP address: 192.0.2.10 (this is a fake, RFC 5735 documentation address).

The laptop had the following characteristics:

  • Operating System: Microsoft Windows XP SP3.
  • VNC package: TightVNC 1.3.10, installed from the OpenDisc software collection.
  • Role: Controlled computer (VNC server). In real life this would be the PC receiving remote tech support from me.
  • IP address: 192.0.2.20 (this is a fake, RFC 5735 documentation address).

Steps performed to establish the connection

On the desktop workstation (the VNC client, controlling computer):

  • Opened a terminal
  • Ran vncviewer -listen
  • You should get a message like «main: Listening on port 5500»

On the laptop (the VNC server, controlled computer):

  • Went to Start » All Programs » TightVNC and ran Launch TightVNC Server
  • If the Properties window pops up, disable «Accept socket connections» and click OK (just for security reasons).
  • Right click on the system tray TightVNC Server icon and choose Add New Client…
  • Enter the IP address of the desktop workstation, in this example, 192.0.2.10 and click OK or hit Enter.

Sidenotes

  • The test was done with the Windows Firewall enabled. You might get a message like To help protect your computer, Windows Firewall blocked some of this program features. | The computer administrator may unblock this program for: TightVNC Win32 Server when running the Tight VNC Server. You may safely click «OK» because you will initiate connections and not listen for a connection. This message gets inhibited by disabling Accept socket connections in the Properties window.
  • The test was repeated using a restricted Windows account, with a successful result. This gives you a lot of flexibility. You might even try making a portable TightVNC server by following the Step 2 from the instructions on this VNC document from the TinyApps.Org blog
  • Depending on the available bandwidth and latency, it might be necessary to tweak the server on the Properties window.
  • I noticed a somewhat long delay on the first connection attempt, in one case even leading to a connection failing. On the second try it worked fine. I would guess this has to do with DNS resolving delays and caching, but it’s just speculation.

Comments welcome. If you have instructions for the same scenario on different platforms, post it on your blog and link it from a comment, or write it directly on a comment.

De creencias y ateísmo

Atheism / Personally, I find atheists just as annoying as fundamentalist christians. / Well, the important thing is that you've found a way to feel superior to both.
From XKCD

Casualidad de la vida. recientemente dije por Twitter lo siguiente:

Debatir si existe o no existe «Dios» es como debatir si el 0 es positivo o negativo. La realidad es que ambos son el mismo número.

Para mí, +0 == -0 y la comparación me gusta. Y sí, ya me criticaron… pero en fin.

En código me lo imagino así:

function dios_existe() {
	if (sign(0) == 1) return True;
	if (sign(0) == -1) return False;
	return dios_existe() /* jaja, porque esto pasa con el ser humano */
}

On beliefs and atheism

Atheism / Personally, I find atheists just as annoying as fundamentalist christians. / Well, the important thing is that you've found a way to feel superior to both.
From XKCD

What a coincidence. I recently said the following over Tweeter (translated from Spanish):

To debate if «God» exists or not is like arguing if 0 is positive or negative. The thruth is both are the same number.

For me, +0 == -0 and I like the analogy. And yes, I have already been criticized… but, oh well.

In code I think it could be like this:

function dios_existe() {
	if (sign(0) == 1) return True;
	if (sign(0) == -1) return False;
	return dios_existe() /* haha, because that's just what happens with human beings */
}

Deshabilitar el EDGE de Telcel en un iPhone desenjaulado usando Debian

La queja

Si quieres saltarte mi berrinche, el procedimiento está aproximadamente a la mitad del post.

La historia comenzó cuando me llegó un recibo inesperadamente alto. Acudí a Telcel al Centro de Atención y, como era de esperar, acabé peléandome con ellos (tan grandotes y tan cortos de visión). Resultó que el cargo era por un alto consumo de datos. (¿Porqué en el aǹo anterior no ocurrió eso?) Aprendí lo siguiente:

  • Si hay EDGE, el iPhone se empeña en usarlo automáticamente si está disponible a falta de red WiFi. Lógico.
  • Aunque el teléfono contempla en su interfaz «Cellular Data Network», con Telcel, esta opción no aparece. Desconozco la causa, pero aquí es donde podría invalidar la configuración.
  • Telcel, según sus representantes en el Centro de Atención, no puede bloquear el servicio de datos carrier-side; sólo por configuración en el teléfono.
  • Con Telcel, y según sus representantes en el Centro de Atención, aunque rebases tu límite de crédito, sigues teniendo datos (según representantes en el Centro de Atención) y te siguen cobrando.
  • En Telcel no hay forma de que te den un detalle de consumo de datos. Esto lo entiendo, pero dudo mucho que no puedan ayudarme a analizar mi tráfico. ¿Qué pasaría si un teléfono se infecta y comienza a usar el Internet a diestra y siniestra?
  • En Telcel no hay forma de que te den el saldo estimado actual en la parte de consumo de datos (que sería útil para er si tu método de bloqueo está funcionando antes de que corte el mes con un recibote).
  • Telcel, según sus representantes en el Centro de Atención, hace firmar una liberación de responsabilidad de Telcel para aquellos que compran iPhone con Telcel en ciertos planes y casos. Es decir aunque hubiera comprado el teléfono con Telcel, da lo mismo.

Mi línea es corporativa y necesito al representante legal para cambiarlo (que las deficiencias en la atención en estos casos es tema de otra queja). Sería demasiado tardado y mientras me seguirían cobrando. Según me dijeron todos los planes incluyen datos (cobrados como si en lugar de radiofrecuencia usara taquiones).

Ahora bien: a mí no me interesa tener los datos con Telcel. Tengo mi WiFi en la casa y el trabajo y no necesito más. Cuando lo requiera, compraré un plan de datos, pero es caro y nunca me ha interesado.

Por fin logré deshabilitar los datos el mi iPhone (desenjaulado y desbloqueado) con Telcel. En los últimos dos meses esto me ocasionó un gasto terrible, inútil e inesperado.

Lo que había intentado, sin éxito

  • Por supuesto, solicitarlo carrier-side.
  • Buscar en la interfaz gráfica un modo de desconfigurar la red. A pesar de algunas recomendaciones en línea, el teléfono no muestra Settings » General » Network » Cellular Data Network.
  • Apagar EDGE y Data con SBSettings. Aparentemente funcionó durante un buen tiempo, pero algo ocurrió que simplemente dejó de bloquear los datos. Aparentemente las aplicaciones la vuelven a prender.
  • Instalar APN Editor, pero no se instala con las versiones 3.x.
  • Quitar los APN del Carrier Bundle a mano. No funcionó y al final no supe si el teléfono leyó el nuevo archivo o no.
  • Usar edge off, pero no supe si hizo algo o no.
  • Apagar la interfaz pdp_ip0 con ifconfig pdp_ip0 down, pero a pesar de eso, se conectaba a páginas.
  • Quitar la ruta por default, pero no me supe la sintaxis, jaja.
  • Meter «127.0.0.1» para internet.itelcel.com en /etc/hosts, pero en pruebas iniciales, cerrando Google, no sirvió de nada.

El procedimiento

Lo que funcionó fue modificar el archivo del Carrier Bundle para que el teléfono me permitiera editar el APN por medio de la función Settings » General » Network » Cellular Data Network.

Esto se logra de la siguiente manera:

  1. Instalé las utilerías para edición de listas de propiedades en Debian: sudo apt-get install libplist-utils
  2. Por SSH, descargué el archivo de Carrier Bundle de Telcel: scp mobile@192.168.2.101:'/System/Library/Carrier Bundles/Telcel_mx.bundle/carrier.plist' .
  3. Exporté el archivo con plutil -in carrier.plist -o carrier.xml
  4. Con gedit edité el archivo y le agregé la <key>AllowEDGEEditing</key><true />.
  5. Guardé el archivo nuevamente.
  6. Lo exporté de vuelta con plutil -in carrier.xml -out carrier-edit.plist. Nótese que estoy usando otro nombre, porque pretendo respaldar antes el que el teléfono ya tiene.
  7. Lo subí al iPhone con scp carrier-edit.plist root@192.168.2.101:'/System/Library/Carrier Bundles/Telcel_mx.bundle/carrier.plist'.
  8. Entre la desesperación reinicié el teléfono con tal de asegurarme que los cambios entraran. Desconozco si es un requisito o no.
  9. Finalmente, entré a Settings » General » Network » Cellular Data Network y le quité una letra al usuario, al password y a la palabra «internet» en «internet.itelcel.com».

Ya solo falta probar cuál es el nivel de persistencia de esta modificación, es decir, si no se regresa a un valor correcto después de cierto tiempo o evento. Aparentemente sobrevive un reinicio.

Otras rarezas

A pesar de que ya no descarga correos ni se conecta al App Store a menos que haya WiFi, la página www.google.com.mx sigue cargando. ¿Alguien me puede explicar por qué?