OSDN Git Service

luci-app-unblockneteasemusic: initial fw4 support
[immortalwrt/luci.git] / applications / luci-app-unblockneteasemusic / root / usr / share / unblockneteasemusic / rules / chain.uc
1 {%
2
3 let http_port = o_http_port;
4 let https_port = o_https_port;
5
6 %}
7
8 chain netease_cloud_music {
9         type nat hook prerouting priority -1;
10         meta l4proto tcp ip daddr @neteasemusic_ipv4 jump netease_cloud_music_redir;
11         meta l4proto tcp ip6 daddr @neteasemusic_ipv6 jump netease_cloud_music_redir;
12 }
13
14 chain netease_cloud_music_redir {
15         ip daddr @local_addr_ipv4 return;
16         ip saddr @acl_neteasemusic_http_ipv4 accept;
17         ip saddr @acl_neteasemusic_https_ipv4 accept;
18         ip6 daddr @local_addr_ipv6 return;
19         ip6 saddr @acl_neteasemusic_http_ipv6 accept;
20         ip6 saddr @acl_neteasemusic_https_ipv6 accept;
21         tcp dport 80 counter redirect to :{{ http_port }};
22         tcp dport 443 counter redirect to :{{ https_port }};
23 }
24
25