Van iptables ken ik helaas niets. Het enige wat ik weet is dat de firewall regels omgezet worden in regels voor iptables. Ik post hieronder de verschillende bestanden, alsook de inhoud van de iptables. Zoals te zien tracht ik op dit moment enkel poort 7000 te forwarden.
De regel die jij aanhaalt zit er niet in. Ik zal er eens wat over opzoeken en dan een gelijkaardige regel trachten toe te voegen.
/etc/config/firewall:
config defaults
option syn_flood '0'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
config zone
option name 'lan'
option network 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
config zone
option name 'wan'
option network 'wan'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
config forwarding
option src 'lan'
option dest 'wan'
config rule
option name 'Allow-DHCP-Renew'
option src 'wan'
option proto 'udp'
option dest_port '68'
option target 'ACCEPT'
option family 'ipv4'
config rule
option name 'Allow-Ping'
option src 'wan'
option proto 'icmp'
option icmp_type 'echo-request'
option family 'ipv4'
option target 'ACCEPT'
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'
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'
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'
config include 'wanmonitor'
option path '/usr/sbin/wan.monitor start'
option reload '1'
option enabled '1'
config include 'webinitrdr'
option path '/lib/firewall.sysapi.loader webinitrdr'
option reload '1'
option enabled '1'
config include 'dnsmiwifi'
option path '/lib/firewall.sysapi.loader dnsmiwifi'
option reload '1'
option enabled '1'
config include 'ttlset'
option path '/lib/firewall.sysapi.loader ttlset'
option reload '1'
option enabled '1'
config include 'portalfilter'
option path '/lib/firewall.sysapi.loader portalfilter'
option reload '1'
option enabled '1'
config include 'macfilter'
option path '/lib/firewall.sysapi.loader macfilter'
option reload '1'
option enabled '1'
config include 'miqos'
option path '/lib/firewall.sysapi.loader miqos'
option reload '1'
config include 'firewalluser'
option path '/etc/firewall.user'
option reload '1'
config rule 'xunleiwantcpports'
option src 'wan'
option dest_port '1080 4662 2080 2062'
option proto 'tcp'
option target 'ACCEPT'
option name ''\''xunlei wan accept tcp port 1080 4662 2080 2062'\'''
config rule 'xunleiwanudpports'
option name 'xunlei wan accept udp port 4661 3027 888 666 2037 2061 2048 2066'
option src 'wan'
option dest_port '4661 3027 888 666 2037 2061 2048 2066'
option proto 'udp'
option target 'ACCEPT'
config include 'miniupnpd'
option type 'script'
option path '/usr/share/miniupnpd/firewall.include'
option family 'IPv4'
option reload '1'
config redirect 'web2'
option name 'web2'
option src 'wan'
option proto 'tcpudp'
option src_dport '7000'
option dest_ip '192.168.31.230'
option dest_port '7000'
option dest 'lan'
option target 'DNAT'
sysctl.conf:
kernel.panic=3
fs.file-max = 1000000
net.ipv4.conf.default.arp_ignore=1
net.ipv4.conf.all.arp_ignore=1
net.ipv4.ip_forward=1
net.ipv4.icmp_echo_ignore_broadcasts=1
net.ipv4.icmp_ignore_bogus_error_responses=1
net.ipv4.tcp_ecn=0
net.ipv4.tcp_fin_timeout=10
net.ipv4.tcp_keepalive_time=60
net.ipv4.tcp_syncookies=1
net.ipv4.tcp_timestamps=1
net.ipv4.tcp_sack=1
net.ipv4.tcp_dsack=1
net.ipv4.tcp_mtu_probing=1
net.ipv6.conf.default.forwarding=1
net.ipv6.conf.all.forwarding=1
net.netfilter.nf_conntrack_acct=1
net.netfilter.nf_conntrack_checksum=0
net.netfilter.nf_conntrack_max=81920
net.netfilter.nf_conntrack_tcp_timeout_established=600
net.netfilter.nf_conntrack_udp_timeout=120
net.ipv4.netfilter.ip_conntrack_udp_timeout_stream=30
net.netfilter.nf_conntrack_udp_timeout_stream=180
net.ipv4.netfilter.ip_conntrack_tcp_timeout_syn_sent=60
net.ipv4.netfilter.ip_conntrack_tcp_timeout_syn_sent2=60
net.ipv4.netfilter.ip_conntrack_tcp_timeout_syn_recv=30
net.ipv4.netfilter.ip_conntrack_tcp_timeout_fin_wait=10
net.ipv4.netfilter.ip_conntrack_tcp_timeout_close_wait=30
net.ipv4.netfilter.ip_conntrack_tcp_timeout_last_ack=10
net.ipv4.netfilter.ip_conntrack_tcp_timeout_time_wait=10
net.ipv4.netfilter.ip_conntrack_tcp_timeout_max_retrans=30
net.ipv4.tcp_max_tw_buckets=40960
#net.ipv4.netfilter.ip_conntrack_buckets=8192
net.ipv4.ip_local_port_range=1025 65530
net.ipv4.tcp_tw_reuse=1
# disable bridge firewalling by default
net.bridge.bridge-nf-call-arptables=0
net.bridge.bridge-nf-call-ip6tables=0
net.bridge.bridge-nf-call-iptables=0
vm.dirty_background_ratio=5
vm.dirty_ratio=10
vm.dirty_expire_centisecs=500
vm.dirty_writeback_centisecs=200
vm.swappiness=80
vm.vfs_cache_pressure=120
vm.min_free_kbytes=32768
iptables -L -v -n:
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
86728 7079K delegate_input all -- * * 0.0.0.0/0 0.0.0.0/0
Chain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
23325 1756K delegate_forward all -- * * 0.0.0.0/0 0.0.0.0/0
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
42402 160M delegate_output all -- * * 0.0.0.0/0 0.0.0.0/0
Chain MINIUPNPD (1 references)
pkts bytes target prot opt in out source destination
0 0 ACCEPT udp -- * * 0.0.0.0/0 192.168.31.130 udp dpt:64275
0 0 ACCEPT udp -- * * 0.0.0.0/0 192.168.31.130 udp dpt:64102
Chain delegate_forward (1 references)
pkts bytes target prot opt in out source destination
23325 1756K forwarding_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for forwarding */
12109 1136K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
916 49543 zone_lan_forward all -- br-lan * 0.0.0.0/0 0.0.0.0/0
0 0 zone_wan_forward all -- pppoe-wan * 0.0.0.0/0 0.0.0.0/0
0 0 reject all -- * * 0.0.0.0/0 0.0.0.0/0
Chain delegate_input (1 references)
pkts bytes target prot opt in out source destination
8389 968K ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
78339 6111K input_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for input */
69929 5401K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
4224 402K zone_lan_input all -- br-lan * 0.0.0.0/0 0.0.0.0/0
4186 308K zone_wan_input all -- pppoe-wan * 0.0.0.0/0 0.0.0.0/0
Chain delegate_output (1 references)
pkts bytes target prot opt in out source destination
8389 968K ACCEPT all -- * lo 0.0.0.0/0 0.0.0.0/0
34013 159M output_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for output */
20453 158M ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
3788 978K zone_lan_output all -- * br-lan 0.0.0.0/0 0.0.0.0/0
9772 569K zone_wan_output all -- * pppoe-wan 0.0.0.0/0 0.0.0.0/0
Chain forwarding_lan_rule (1 references)
pkts bytes target prot opt in out source destination
Chain forwarding_rule (1 references)
pkts bytes target prot opt in out source destination
23325 1756K macfilter_wan all -- * * 0.0.0.0/0 0.0.0.0/0
Chain forwarding_wan_rule (1 references)
pkts bytes target prot opt in out source destination
Chain input_lan_rule (1 references)
pkts bytes target prot opt in out source destination
Chain input_rule (1 references)
pkts bytes target prot opt in out source destination
598 70021 macfilter_admin tcp -- br-lan * 0.0.0.0/0 192.168.31.1 multiport dports 80,443,23,22
Chain input_wan_rule (1 references)
pkts bytes target prot opt in out source destination
Chain macfilter_admin (1 references)
pkts bytes target prot opt in out source destination
Chain macfilter_lan (0 references)
pkts bytes target prot opt in out source destination
Chain macfilter_wan (1 references)
pkts bytes target prot opt in out source destination
9060 472K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 MAC 70:18:8B:82:16:15
187 10969 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 MAC F6:D0:10:12:E6:44
1053 87893 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 MAC 00:1D:09:BD:E5:C2
Chain output_lan_rule (1 references)
pkts bytes target prot opt in out source destination
Chain output_rule (1 references)
pkts bytes target prot opt in out source destination
Chain output_wan_rule (1 references)
pkts bytes target prot opt in out source destination
Chain reject (3 references)
pkts bytes target prot opt in out source destination
1053 44124 REJECT tcp -- * * 0.0.0.0/0 0.0.0.0/0 reject-with tcp-reset
3132 263K REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable
Chain zone_lan_dest_ACCEPT (3 references)
pkts bytes target prot opt in out source destination
3788 978K ACCEPT all -- * br-lan 0.0.0.0/0 0.0.0.0/0
Chain zone_lan_forward (1 references)
pkts bytes target prot opt in out source destination
916 49543 forwarding_lan_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for forwarding */
0 0 zone_lan_dest_ACCEPT tcp -- * * 192.168.31.0/24 192.168.31.230 tcp dpt:7000 /* web2 (reflection) */
0 0 zone_lan_dest_ACCEPT udp -- * * 192.168.31.0/24 192.168.31.230 udp dpt:7000 /* web2 (reflection) */
916 49543 zone_wan_dest_ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 /* forwarding lan -> wan */
0 0 zone_lan_src_REJECT all -- * * 0.0.0.0/0 0.0.0.0/0
Chain zone_lan_input (1 references)
pkts bytes target prot opt in out source destination
4224 402K input_lan_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for input */
4224 402K zone_lan_src_ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0
Chain zone_lan_output (1 references)
pkts bytes target prot opt in out source destination
3788 978K output_lan_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for output */
3788 978K zone_lan_dest_ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0
Chain zone_lan_src_ACCEPT (1 references)
pkts bytes target prot opt in out source destination
4224 402K ACCEPT all -- br-lan * 0.0.0.0/0 0.0.0.0/0
Chain zone_lan_src_REJECT (1 references)
pkts bytes target prot opt in out source destination
0 0 reject all -- br-lan * 0.0.0.0/0 0.0.0.0/0
Chain zone_wan_dest_ACCEPT (2 references)
pkts bytes target prot opt in out source destination
10688 618K ACCEPT all -- * pppoe-wan 0.0.0.0/0 0.0.0.0/0
Chain zone_wan_forward (1 references)
pkts bytes target prot opt in out source destination
0 0 MINIUPNPD all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 forwarding_wan_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for forwarding */
0 0 ACCEPT tcp -- * * 0.0.0.0/0 192.168.31.230 tcp dpt:7000 /* web2 */
0 0 ACCEPT udp -- * * 0.0.0.0/0 192.168.31.230 udp dpt:7000 /* web2 */
0 0 zone_wan_src_REJECT all -- * * 0.0.0.0/0 0.0.0.0/0
Chain zone_wan_input (1 references)
pkts bytes target prot opt in out source destination
4186 308K input_wan_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for input */
0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:68 /* Allow-DHCP-Renew */
1 28 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0 icmptype 8 /* Allow-Ping */
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:1080 /* 'xunlei wan accept tcp port 1080 4662 2080 2062' */
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:4662 /* 'xunlei wan accept tcp port 1080 4662 2080 2062' */
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:2080 /* 'xunlei wan accept tcp port 1080 4662 2080 2062' */
0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:2062 /* 'xunlei wan accept tcp port 1080 4662 2080 2062' */
0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:4661 /* xunlei wan accept udp port 4661 3027 888 666 2037 2061 2048 2066 */
0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:3027 /* xunlei wan accept udp port 4661 3027 888 666 2037 2061 2048 2066 */
0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:888 /* xunlei wan accept udp port 4661 3027 888 666 2037 2061 2048 2066 */
0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:666 /* xunlei wan accept udp port 4661 3027 888 666 2037 2061 2048 2066 */
0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:2037 /* xunlei wan accept udp port 4661 3027 888 666 2037 2061 2048 2066 */
0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:2061 /* xunlei wan accept udp port 4661 3027 888 666 2037 2061 2048 2066 */
0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:2048 /* xunlei wan accept udp port 4661 3027 888 666 2037 2061 2048 2066 */
0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:2066 /* xunlei wan accept udp port 4661 3027 888 666 2037 2061 2048 2066 */
4185 308K zone_wan_src_REJECT all -- * * 0.0.0.0/0 0.0.0.0/0
Chain zone_wan_output (1 references)
pkts bytes target prot opt in out source destination
9772 569K output_wan_rule all -- * * 0.0.0.0/0 0.0.0.0/0 /* user chain for output */
9772 569K zone_wan_dest_ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0
Chain zone_wan_src_REJECT (2 references)
pkts bytes target prot opt in out source destination
4185 308K reject all -- pppoe-wan * 0.0.0.0/0 0.0.0.0/0