Openwrt HG556a
Primero hay que leer y hacer todo lo que dice esta web:
Una vez hecho, para acceder a él por primera vez:
$ sudo ifconfig 192.168.1.2 $ telnet 192.168.1.1
Una vez dentro hay que cambiar la contraseña de root. Esto también desactiva el telnet y activa ssh.
# passwd
Esperar a que SSH esté funcionando correctamente.
$ ssh root@192.168.1.1
Configurar la red:
En mi caso, que quiero usar los 3 primeros puertos para LAN y el 4 para WAN, este es el contenido de /etc/config/network:
config interface 'loopback' option ifname 'lo' option proto 'static' option ipaddr '127.0.0.1' option netmask '255.0.0.0' config globals 'globals' option ula_prefix 'fd2e:2358:4440::/48' config interface 'lan' option ifname 'eth0.1' option force_link '1' option type 'bridge' option proto 'static' option ipaddr '192.168.1.1' option netmask '255.255.255.0' option ip6assign '60' config interface 'wan' option ifname 'eth0.2' option proto 'dhcp' config switch option name 'eth0' option reset '1' option enable_vlan '1' config switch_vlan option device 'eth0' option vlan '1' option ports '0 1 2 5t' config switch_vlan option device eth0 option vlan '2' option ports '3 5t'
No olvidar reiniciar:
# /etc/init.d/network restart
Conectar el router en su sitio. El puerto 4 a la WAN y cualquiera de los otros al switch de LAN o a los PC.
Ahora debería estar conectado a Internet.
Luci
Vamos a instalar la interfaz web:
# opkg update # opkg install luci # /etc/init.d/uhttpd start
Filtrado
opkg update opkg install tinyproxy luci-app-tinyproxy
uci set tinyproxy.@tinyproxy[0].enable=1
uci commit
/etc/init.d/tinyproxy enable
/etc/init.d/tinyproxy restart
uci add firewall redirect uci set firewall.@redirect[0].name='Transparent Proxy Redirect' uci set firewall.@redirect[0].src=lan uci set firewall.@redirect[0].proto=tcp uci set firewall.@redirect[0].dest_port=8080 uci set firewall.@redirect[0].src_dport=80 uci set firewall.@redirect[0].src_dip='!192.168.1.1' uci set firewall.@redirect[0].dest_ip=192.168.1.1 uci commit firewall /etc/init.d/firewall restart
El resultado de la configuración se puede ver en Luci, aunque no todo se puede hacer a través de la web.
config tinyproxy option enabled '1' option User 'root' option Group 'root' option Port '8080' option Timeout '600' option DefaultErrorFile '/usr/share/tinyproxy/default.html' option StatFile '/usr/share/tinyproxy/stats.html' option LogFile '/var/log/tinyproxy.log' option LogLevel 'Error' option MaxClients '100' option MinSpareServers '5' option MaxSpareServers '20' option StartServers '10' option MaxRequestsPerChild '10000' list Allow '127.0.0.1' list Allow '192.168.1.0/24' list Allow '::ffff:0:0/96' option Timeout '120' option ViaProxyName 'tinyproxy' list ConnectPort '443' list ConnectPort '563' option enable '1' option Filter '/etc/tinyproxy/filter' option FilterURLs 'On' option FilterExtended 'On' FilterCaseSensitive 'Off'