Greetings,
I'm a longtime DD-WRT user who recently decided to try OpenWRT because of better opkg compatibility. Two days ago I flashed BARRIER BREAKER 14.07, r42625 onto my Netgear WNDR3700v4 and since that time, have experienced a series of firewall and connectivity headaches. I'm clearly doing something wrong and need some expert advice.
Network Topology:
I operate offices at several project sites where my equipment is installed on a separate wired subnet. Unlike other users, this is not wishful thinking or a network misconfiguration, it is entirely by design and absolutely necessary. For years I have configured these installations on a number of different network devices without much difficulty, some OEM, others flashed with DD-WRT.
For simplicity, the basic procedure is described as follows: A router ("subnet router") is attached to the primary Gateway ("internet gateway") by connecting an ethernet cable between the LAN port of the "internet gateway" and WAN port of the "subnet router", creating a separate subnet. I have administrative rights and can reconfigure any necessary settings.
Most network devices, including DD-WRT firmware, provide a convenient option to disable the firewall, a configuration often called "Router Mode". This option has historically been used to provide subnet clients access to the Internet, groups of printers, other users, etc. I usually create routes on upstream devices such as the "internet gateway" which requires regular monitoring.
Of course an OpenWRT device can be configured to operate in "Router Mode" like any other router, however, simply disabling the firewall does not create the intended result. I spent a great deal of time searching the site, finding many comments that "it couldn't be done", a few interesting hints, but no definitive solutions. Last night I experienced perfect connectivity bliss for about 30 minutes before the firewall kicked in with a vengeance. I'm close to a solution and intend to share my results in a separate posting but only after the settings are scrutinized and the firewall is under control.
Symptoms have always included no Internet access and chronic generation of unusual MAC Addresses. Regularly include firewall settings that don't stick, firewall option checkboxes in GUI which briefly appear as LAN or WAN options, then quickly vanish, leaving the blank field "unspecified -or- create", and subsequent text values added to these fields which are never saved. In CLI, the restart command: /etc/init.d/firewall restart, throws the error:"Parse error (option/list command found before the first section) at line 2, byte 1", however, previously added configs have been removed and nothing I find matches the error.
There's also a known bug for this model regarding assignment of VLAN values but I'm unsure if this could be the problem.
Thanks in advance for any help.
UG
Here are the basic settings from /etc/firewall.user, /etc/config/firewall, and /etc/config/network.
firewall.user (what I would like to add but can't)
config rule
option src 'wan'
option src_ip '192.168.1.0/24'
option dest 'lan'
option dest_ip '192.168.0.0/24'
option proto 'all'
option target 'ACCEPT'
FIREWALL (looks generic):
#config defaults
option syn_flood 1
option input ACCEPT
option output ACCEPT
option forward REJECT
# Uncomment this line to disable ipv6 rules
# option disable_ipv6 1
# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
config rule
option name Allow-DHCP-Renew
option src wan
option proto udp
option dest_port 68
option target ACCEPT
option family ipv4
# Allow IPv4 ping
config rule
option name Allow-Ping
option src wan
option proto icmp
option icmp_type echo-request
option family ipv4
option target ACCEPT
# Allow DHCPv6 replies
# see https://dev.openwrt.org/ticket/10381
config rule
option name Allow-DHCPv6
option src wan
option proto udp
option src_ip fe80::/10
option src_port 547
option dest_ip fe80::/10
option dest_port 546
option family ipv6
option target ACCEPT
# Allow essential incoming IPv6 ICMP traffic
config rule
option name Allow-ICMPv6-Input
option src wan
option proto icmp
list icmp_type echo-request
list icmp_type echo-reply
list icmp_type destination-unreachable
list icmp_type packet-too-big
list icmp_type time-exceeded
list icmp_type bad-header
list icmp_type unknown-header-type
list icmp_type router-solicitation
list icmp_type neighbour-solicitation
list icmp_type router-advertisement
list icmp_type neighbour-advertisement
option limit 1000/sec
option family ipv6
option target ACCEPT
# Allow essential forwarded IPv6 ICMP traffic
config rule
option name Allow-ICMPv6-Forward
option src wan
option dest *
option proto icmp
list icmp_type echo-request
list icmp_type echo-reply
list icmp_type destination-unreachable
list icmp_type packet-too-big
list icmp_type time-exceeded
list icmp_type bad-header
list icmp_type unknown-header-type
option limit 1000/sec
option family ipv6
option target ACCEPT
# include a file with users custom iptables rules
config include
option path /etc/firewall.user
NETWORK:
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fdb8:b9bc:32a6::/48'
config interface 'lan'
option ifname 'eth0.1'
option force_link '1'
option type 'bridge'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option macaddr '04:a1:51:9e:72:fe'
option ipaddr '192.168.0.1'
config interface 'wan'
option ifname 'eth0.2'
option _orig_ifname 'eth0.2'
option _orig_bridge 'false'
option proto 'static'
option ipaddr '192.168.1.5'
option netmask '255.255.255.0'
option gateway '192.168.1.1'
option metric '1'
option macaddr '04:a1:51:9e:72:ff'
config interface 'wan6'
option ifname '@wan'
option proto 'dhcpv6'
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
config switch_vlan
option device 'switch0'
option vlan '1'
option ports '0t 1 2 3 4'
config switch_vlan
option device 'switch0'
option vlan '2'
option ports '0t 5'