Configurer un routeur pour activer le WEB depuis le coté WAN

De knowledge
Aller à la navigation Aller à la recherche

De la même façon que pour l'acces ssh on peut activer l'acces WEB du côté WAN.

Attention si le côté WAN est réellement l'internet public c'est assez dangereux.

Configuration

HTTP

On configure l'accès par les commandes :

uci add firewall rule
uci set firewall.@rule[-1].name='Allow-WAN-HTTP'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='80'
uci set firewall.@rule[-1].target='ACCEPT'

HTTPs

Par défaut il n'est pas activé mais si le WAN en question est réellement l'internet public ca pourrait être une option valide. Dans ce cas:

uci add firewall rule
uci set firewall.@rule[-1].name='Allow-WAN-HTTPS'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='443'
uci set firewall.@rule[-1].target='ACCEPT'

Validation

On "commite" le tout par:

uci commit firewall
/etc/init.d/firewall restart

Chez moi ça a marché comme ça mais sur certaines installations le serveur web lui même n'écoute pas sur toute les "pattes". Il faut alors :

uci set uhttpd.main.listen_http='0.0.0.0:80'
uci set uhttpd.main.listen_https='0.0.0.0:443'
uci commit uhttpd
/etc/init.d/uhttpd restart