====== OPNSense - Règles de firewall pour un réseau invité ====== Créer au préalable les interfaces et le serveur DHCP ===== Configuration des règles ===== - Dans Firewall -> Aliases, nous allons d'abord créer un alias AllIPV4localnet qui va identifier tous les réseaux locaux pour les bloquer facilement. Mettez-y : * 10.0.0.0/8 * 192.168.0.0/16 * 172.16.0.0/12{{:reseau:opnsense:pasted:20200222-192624.png}} - Dans Firewall -> Rules -> Guest créer les règles suivantes: * DNS: * Protocol **IPv4 TCP/UDP** * Destination **8.8.8.8** * Port **53** * HTTP: * Protocol **IPv4 TCP** * Destination **!AllIPV4localnet (AllIPV4localnet inversé)** * Port **80** * HTTPS: * Protocol **IPv4 TCP** * Destination **!AllIPV4localnet (AllIPV4localnet inversé)** * Port **443** * IMAP: * Protocol **IPv4 TCP** * Destination **!AllIPV4localnet (AllIPV4localnet inversé)** * Port **143** * IMAPS: * Protocol **IPv4 TCP** * Destination **!AllIPV4localnet (AllIPV4localnet inversé)** * Port **993** * POP3: * Protocol **IPv4 TCP** * Destination **!AllIPV4localnet (AllIPV4localnet inversé)** * Port **110** * POP3S: * Protocol **IPv4 TCP** * Destination **!AllIPV4localnet (AllIPV4localnet inversé)** * Port **995** * SMTP: * Protocol **IPv4 TCP** * Destination **!AllIPV4localnet (AllIPV4localnet inversé)** * Port **25** * SMTPS: * Protocol **IPv4 TCP** * Destination **!AllIPV4localnet (AllIPV4localnet inversé)** * Port **465** * Whatsapp1: * Protocol **IPv4 TCP** * Destination **!AllIPV4localnet (AllIPV4localnet inversé)** * Port **5222 - 5223** * Whatsapp2: * Protocol **IPv4 TCP** * Destination **!AllIPV4localnet (AllIPV4localnet inversé)** * Port **5228** * Teamviewer: * Protocol **IPv4 TCP&UDP** * Destination **!AllIPV4localnet (AllIPV4localnet inversé)** * Port **5938** * Anydesk: * Protocol **IPv4 TCP** * Destination **!AllIPV4localnet (AllIPV4localnet inversé)** * Port **6568** {{:reseau:opnsense:pasted:20200222-193137.png}} ===== Configuration du shaping ===== - Dans Firewall -> Shaper -> Settings -> Pipe créer * Une interface Down de 2Mb en mask=destination * Une interface Up de 1Mb en mask=destination{{:reseau:opnsense:pasted:20200223-081332.png}} - Dans Firewall -> Shaper -> Settings -> Rules créer en mode advanced * Interface Wan / Interface 2: LAN_GUEST_PORTAL Direction IN Target Down2mb * Interface Wan / Interface 2: LAN_GUEST_PORTAL Direction Out Target Up1mb{{:reseau:opnsense:pasted:20200223-081630.png}}