Tableau 58. Transfert du trafic http (et non pas HTTPS) vers le serveur Web qui s'exécute sur 192.168.1.10 :
sudo uci add firewall redirect
sudo uci set firewall.@redirect[-1].enabled=1
sudo uci set firewall.@redirect[-1].proto=tcp
sudo uci set firewall.@redirect[-1].src=wan
sudo uci set firewall.@redirect[-1].src_dport=80
sudo uci set firewall.@redirect[-1].dest=lan
sudo uci set firewall.@redirect[-1].dest_ip=192.168.1.10
sudo uci commit firewall
sudo /etc/init.d/firewall restart
Ajout d'une nouvelle règle de trafic
Tableau 59. Ajout d'une nouvelle règle de trafic
Syntaxe
sudo uci add firewall rule
sudo uci set firewall.@rule[-1].enabled=<enabled>
sudo uci set firewall.@rule[-1].name=<name>
sudo uci set firewall.@rule[-1].family=<family>
sudo uci set firewall.@rule[-1].proto=<proto>
sudo uci set firewall.@rule[-1].src=<src>
sudo uci set firewall.@rule[-1].src_mac=<src_mac>
sudo uci set firewall.@rule[-1].src_ip=<src_ip>
sudo uci set firewall.@rule[-1].src_port=<src_port>
sudo uci set firewall.@rule[-1].dest=<dest>
sudo uci set firewall.@rule[-1].dest_ip=<dest_ip>
sudo uci set firewall.@rule[-1].dest_port=<dest_port>
sudo uci set firewall.@rule[-1].target=<target>
sudo uci set firewall.@rule[-1].weekdays=<weekdays>
sudo uci set firewall.@rule[-1].monthdays=<monthdays>
sudo uci set firewall.@rule[-1].start_time=<start_time>
sudo uci set firewall.@rule[-1].stop_time=<stop_time>
sudo uci set firewall.@rule[-1].start_date=<start_date>
sudo uci set firewall.@rule[-1].stop_date=<stop_date>
sudo uci set firewall.@rule[-1].utc_time=<utc_time>
uci commit firewall
Tableau 60. Paramètres
Paramètre
Type
120
Requis
Par
défaut
Description