**Configuration du réseau :**



package network



config interface 'loopback'

&#x20;       option device 'lo'

&#x20;       option proto 'static'

&#x20;       option ipaddr '127.0.0.1'

&#x20;       option netmask '255.0.0.0'



config globals 'globals'

&#x20;       option ula\_prefix 'fd11:f295:ee6c::/48'

&#x20;       option packet\_steering '1'



config device

&#x20;       option name 'br-lan'

&#x20;       option type 'bridge'

&#x20;       list ports 'eth1'

&#x20;       list ports 'eth2'

&#x20;       list ports 'eth3'

&#x20;       list ports 'eth4'



config device

&#x20;       option name 'eth1'

&#x20;       option macaddr '\*\*\*\*'



config device

&#x20;       option name 'eth2'

&#x20;       option macaddr '\*\*\*\*'



config device

&#x20;       option name 'eth3'

&#x20;       option macaddr '\*\*\*\*'



config device

&#x20;       option name 'eth4'

&#x20;       option macaddr '\*\*\*\*'



config interface 'lan'

&#x20;       option device 'br-lan'

&#x20;       option proto 'static'

&#x20;       option ipaddr '10.0.0.1'

&#x20;       option netmask '255.255.255.0'

&#x20;       option ip6assign '60'



config device

&#x20;       option name 'eth0'

&#x20;       option macaddr '\*\*\*\*'



config interface 'wan'

&#x20;       option device 'eth0'

&#x20;       option proto 'dhcp'



config interface 'wan6'

&#x20;       option device 'eth0'

&#x20;       option proto 'dhcpv6'



\--- FIREWALL ---

package firewall



config defaults

&#x20;       option input 'REJECT'

&#x20;       option output 'ACCEPT'

&#x20;       option forward 'REJECT'

&#x20;       option synflood\_protect '1'



config zone

&#x20;       option name 'lan'

&#x20;       list network 'lan'

&#x20;       option input 'ACCEPT'

&#x20;       option output 'ACCEPT'

&#x20;       option forward 'ACCEPT'



config zone

&#x20;       option name 'wan'

&#x20;       list network 'wan'

&#x20;       list network 'wan6'

&#x20;       option input 'REJECT'

&#x20;       option output 'ACCEPT'

&#x20;       option forward 'REJECT'

&#x20;       option masq '1'

&#x20;       option mtu\_fix '1'



config forwarding

&#x20;       option src 'lan'

&#x20;       option dest 'wan'



config rule

&#x20;       option name 'Allow-DHCP-Renew'

&#x20;       option src 'wan'

&#x20;       option proto 'udp'

&#x20;       option dest\_port '68'

&#x20;       option target 'ACCEPT'

&#x20;       option family 'ipv4'



config rule

&#x20;       option name 'Allow-Ping'

&#x20;       option src 'wan'

&#x20;       option proto 'icmp'

&#x20;       option icmp\_type 'echo-request'

&#x20;       option family 'ipv4'

&#x20;       option target 'ACCEPT'



config rule

&#x20;       option name 'Allow-IGMP'

&#x20;       option src 'wan'

&#x20;       option proto 'igmp'

&#x20;       option family 'ipv4'

&#x20;       option target 'ACCEPT'



config rule

&#x20;       option name 'Allow-DHCPv6'

&#x20;       option src 'wan'

&#x20;       option proto 'udp'

&#x20;       option dest\_port '546'

&#x20;       option family 'ipv6'

&#x20;       option target 'ACCEPT'



config rule

&#x20;       option name 'Allow-MLD'

&#x20;       option src 'wan'

&#x20;       option proto 'icmp'

&#x20;       option src\_ip 'fe80::/10'

&#x20;       list icmp\_type '130/0'

&#x20;       list icmp\_type '131/0'

&#x20;       list icmp\_type '132/0'

&#x20;       list icmp\_type '143/0'

&#x20;       option family 'ipv6'

&#x20;       option target 'ACCEPT'



config rule

&#x20;       option name 'Allow-ICMPv6-Input'

&#x20;       option src 'wan'

&#x20;       option proto 'icmp'

&#x20;       list icmp\_type 'echo-request'

&#x20;       list icmp\_type 'echo-reply'

&#x20;       list icmp\_type 'destination-unreachable'

&#x20;       list icmp\_type 'packet-too-big'

&#x20;       list icmp\_type 'time-exceeded'

&#x20;       list icmp\_type 'bad-header'

&#x20;       list icmp\_type 'unknown-header-type'

&#x20;       list icmp\_type 'router-solicitation'

&#x20;       list icmp\_type 'neighbour-solicitation'

&#x20;       list icmp\_type 'router-advertisement'

&#x20;       list icmp\_type 'neighbour-advertisement'

&#x20;       option limit '1000/sec'

&#x20;       option family 'ipv6'

&#x20;       option target 'ACCEPT'



config rule

&#x20;       option name 'Allow-ICMPv6-Forward'

&#x20;       option src 'wan'

&#x20;       option dest '\*'

&#x20;       option proto 'icmp'

&#x20;       list icmp\_type 'echo-request'

&#x20;       list icmp\_type 'echo-reply'

&#x20;       list icmp\_type 'destination-unreachable'

&#x20;       list icmp\_type 'packet-too-big'

&#x20;       list icmp\_type 'time-exceeded'

&#x20;       list icmp\_type 'bad-header'

&#x20;       list icmp\_type 'unknown-header-type'

&#x20;       option limit '1000/sec'

&#x20;       option family 'ipv6'

&#x20;       option target 'ACCEPT'



config rule

&#x20;       option name 'Allow-IPSec-ESP'

&#x20;       option src 'wan'

&#x20;       option dest 'lan'

&#x20;       option proto 'esp'

&#x20;       option target 'ACCEPT'



config rule

&#x20;       option name 'Allow-ISAKMP'

&#x20;       option src 'wan'

&#x20;       option dest 'lan'

&#x20;       option dest\_port '500'

&#x20;       option proto 'udp'

&#x20;       option target 'ACCEPT'



config redirect

&#x20;       option dest 'lan'

&#x20;       option target 'DNAT'

&#x20;       option name 'ntp'

&#x20;       option family 'ipv4'

&#x20;       list proto 'udp'

&#x20;       option src 'wan'

&#x20;       option src\_dport '123'

&#x20;       option dest\_ip '10.0.0.205'

&#x20;       option dest\_port '123'



config forwarding

&#x20;       option src 'wan'

&#x20;       option dest 'lan'



root@OpenWrt:\~#



