Séparation de réseaux sur un TP-link WR841N sous OpenWrt
L'idée est de permettre une séparation de réseaux relativement simple suivant le schéma :
Interfaces physiques | Interface virtuelle | Adresse IP | Fonction | Adressage des machines reliées |
---|---|---|---|---|
1, 2, 3, 4 (connecteurs jaunes) | WAN | DHCP en 192.168.1.x | Réseau local de la machinbox | DHCP depuis la machinbox |
WAN (connecteur bleu) | LAN | 192.168.2.1 | Réseau secondaire | DHCP depuis OpenWrt en 192.168.2.(100-150) |
Wifi | LAN | 192.168.2.1 | Réseau secondaire | DHCP depuis OpenWrt en 192.168.2.(100-150) |
Configuration du switch
VLAN ID | CPU | Port1 | Port2 | Port3 | Port4 |
---|---|---|---|---|---|
1 | tagged | untagged | untagged | untagged | untagged |
Configuration de l'interface LAN
General setup
Protocol : Static adress IPv4 adress : 192.168.2.1 Netmask : 255.255.255.0 DHCP activé
Physical settings
Interface bridge Interfaces : eth1 (LAN) + Wireless (LAN)
Configuration de l'interface WAN
General setup
Protocol : DHCP client
Physical settings
Interface bridge Interface : VLAN Interface eth0.1 (wan)
Firewall
General Settings
Zone –> Forwarding | Input | Output | Forward | Masquerading | MSS clamping |
---|---|---|---|---|---|
lan (LAN) > wan | accept | accept | reject | off | on |
wan (wan) > reject | accept | accept | reject | on | on |
Traffic rules
Séparation des réseaux :
Any traffic From any host in lan To IP range 192.168.1.0/24 in wan > discard forward
Refuser l'accès au TP-link depuis le réseau secondaire :
Any traffic From any host in lan To any router IP at port 443 on this device > Refuse input Any traffic From any host in lan To any router IP at port 22 on this device > Refuse input Any traffic From any host in lan To any router IP at port 80 on this device > Refuse input