fabianishere / udm-iptv

Helper tool for configuring routed IPTV on the UniFi Dream Machine (Pro)
GNU General Public License v2.0
429 stars 67 forks source link

UCG-max default WAN interface incorrect #351

Open lkneppers opened 2 months ago

lkneppers commented 2 months ago

What is your ISP? (if relevant)

KPN

Diagnostic Information

Output of ifconfig -a:

root@UCG-Max:~# ifconfig -a br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 9216 inet 192.168.1.1 netmask 255.255.255.0 broadcast 0.0.0.0 inet6 fe80::2870:4eff:fe6e:664a prefixlen 64 scopeid 0x20 inet6 xxx prefixlen 64 scopeid 0x0 ether 2a:70:4e:XX:XX:XX txqueuelen 1000 (Ethernet) RX packets 165718 bytes 40359526 (38.4 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 260562 bytes 268446599 (256.0 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

dummy0: flags=130<BROADCAST,NOARP> mtu 1500 ether 5e:0d:80:XX:XX:XX txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet6 fe80::2a70:4eff:fe6e:6649 prefixlen 64 scopeid 0x20 ether 28:70:4e:XX:XX:XX txqueuelen 1000 (Ethernet) RX packets 150 bytes 23934 (23.3 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 158 bytes 37892 (37.0 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet6 fe80::2a70:4eff:fe6e:664a prefixlen 64 scopeid 0x20 ether 28:70:4e:XX:XX:XX txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 151 bytes 36170 (35.3 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet6 fe80::2a70:4eff:fe6e:664b prefixlen 64 scopeid 0x20 ether 28:70:4e:XX:XX:XX txqueuelen 1000 (Ethernet) RX packets 146 bytes 24360 (23.7 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 155 bytes 37154 (36.2 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet6 fe80::2a70:4eff:fe6e:664c prefixlen 64 scopeid 0x20 ether 28:70:4e:XX:XX:XX txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 151 bytes 36170 (35.3 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet6 fe80::2a70:4eff:fe6e:664d prefixlen 64 scopeid 0x20 ether 28:70:4e:6e:66:4d txqueuelen 1000 (Ethernet) RX packets 257061 bytes 258264369 (246.3 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 144464 bytes 36608605 (34.9 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device base 0x1000

eth4.6: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet6 fe80::2a70:4eff:fe6e:664d prefixlen 64 scopeid 0x20 ether 28:70:4e:XX:XX:XX txqueuelen 1000 (Ethernet) RX packets 250686 bytes 243997551 (232.6 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 144116 bytes 35397264 (33.7 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

ifb0: flags=130<BROADCAST,NOARP> mtu 1500 ether 62:b3:df:XX:XX:XX txqueuelen 32 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

ifb1: flags=130<BROADCAST,NOARP> mtu 1500 ether ee:a1:a4:XX:XX:XX txqueuelen 32 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1000 (Local Loopback) RX packets 319402 bytes 217732422 (207.6 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 319402 bytes 217732422 (207.6 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

miireg: flags=0< mtu 0 netrom txqueuelen 1000 (AMPR NET/ROM) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1492 inet xx.xx.xx.xx netmask 255.255.255.255 destination 195.190.228.6 inet6 fe80::24fa:7982:866a:f9ef prefixlen 128 scopeid 0x20 ppp txqueuelen 1000 (Point-to-Point Protocol) RX packets 250537 bytes 241965068 (230.7 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 143960 bytes 32224894 (30.7 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

switch0: flags=4419<UP,BROADCAST,RUNNING,PROMISC,MULTICAST> mtu 9216 inet6 fe80::2870:4eff:fe6e:664a prefixlen 64 scopeid 0x20 ether 2a:70:4e:XX.XX.XX txqueuelen 1000 (Ethernet) RX packets 173520 bytes 45287388 (43.1 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 261191 bytes 270733951 (258.1 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 device base 0x1200

switch0.1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 9216 inet6 fe80::2870:4eff:fe6e:664a prefixlen 64 scopeid 0x20 ether 2a:70:4e:XX:XX:XX txqueuelen 1000 (Ethernet) RX packets 165725 bytes 40361270 (38.4 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 260569 bytes 268447345 (256.0 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wgsrv1: flags=209<UP,POINTOPOINT,RUNNING,NOARP> mtu 1420 inet 192.168.3.1 netmask 255.255.255.0 destination 192.168.3.1 unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 816 dropped 0 overruns 0 carrier 0 collisions 0

Output of /etc/udm-iptv.conf after setting it up with KPN as provider:

Example configuration for udmp-iptv

Interface on which IPTV traffic enters the router

IPTV_WAN_INTERFACE="eth8"

ID of VLAN which carries IPTV traffic (use 0 if no VLAN is used)

IPTV_WAN_VLAN="4"

Name of the IPTV VLAN interface

IPTV_WAN_VLAN_INTERFACE="iptv"

IP ranges from which the IPTV traffic originates (separated by spaces)

IPTV_WAN_RANGES="213.75.0.0/16 217.166.0.0/16"

DHCP options to send when requesting an IP address

IPTV_WAN_DHCP_OPTIONS="-O staticroutes -V IPTV_RG"

LAN interfaces on which IPTV should be made available

IPTV_LAN_INTERFACES="br0"

Disable quickleave for igmpproxy

IPTV_IGMPPROXY_DISABLE_QUICKLEAVE="false"

Enable debugging for igmpproxy

IPTV_IGMPPROXY_DEBUG="true" IPTV_IGMPPROXY_PROGRAM="improxy"

IPTV_IGMPPROXY_IGMP_VERSION="2"

Describe the Bug

While doing the (initial) setup, the script does not ask on what interface WAN is. By default, the script sets the IPTV_WAN_INTERFACE to eth8 on a UCG-Max. This results in an error when starting the script. eth8 is not present. After manually changing this to eth4 and restarting the script, the issue is gone

Expected Behavior

udm-iptv setup asking for the WAN interface and/or for the script to default to eth4

IPTV_WAN_INTERFACE="eth4"

lkneppers commented 2 months ago

Output of udm-iptv diagnose:

root@UCG-Max:~# udm-iptv diagnose Please share the following output with the developers: === Configuration === WAN Interface: eth8 WAN VLAN: 4 (dev iptv) WAN DHCP: true (options "-O staticroutes -V IPTV_RG") WAN Ranges: 213.75.0.0/16 217.166.0.0/16 LAN Interfaces: br0 IGMP Proxy quickleave disabled: false IGMP Proxy debug: false === IP Link and Route === 19: iptv@eth4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 inet 10.57.150.182/22 brd 10.57.151.255 scope global iptv valid_lft forever preferred_lft forever 10.57.148.0/22 proto kernel scope link src 10.57.xxx.xxx 213.75.112.0/21 via 10.57.148.1 metric 219 === Service Logs === Sep 14 11:33:52 UCG-Max systemd[1]: udm-iptv.service: Main process exited, code=exited, status=1/FAILURE Sep 14 11:33:52 UCG-Max systemd[1]: udm-iptv.service: Failed with result 'exit-code'. Sep 14 11:33:52 UCG-Max systemd[1]: Stopped IPTV support for the UniFi Dream Machine. Sep 14 11:33:52 UCG-Max systemd[1]: Started IPTV support for the UniFi Dream Machine. Sep 14 11:33:53 UCG-Max udm-iptvd[154883]: Device "eth8" does not exist. Sep 14 11:33:53 UCG-Max udm-iptvd[154881]: Device eth8 for iptv does not exist Sep 14 11:33:53 UCG-Max systemd[1]: udm-iptv.service: Main process exited, code=exited, status=1/FAILURE Sep 14 11:33:53 UCG-Max systemd[1]: udm-iptv.service: Failed with result 'exit-code'. Sep 14 11:33:58 UCG-Max systemd[1]: udm-iptv.service: Scheduled restart job, restart counter is at 1. Sep 14 11:33:58 UCG-Max systemd[1]: Stopped IPTV support for the UniFi Dream Machine.

lkneppers commented 2 months ago

Additional info: it seems that the script tries to get the board shortname from /etc/board.info, but it doesn't return info:

root@UCG-Max:/# sed -n 's/^board.shortname=\s*(.)\s/\1/p' /etc/board.info root@UCG-Max:/#

As well as the 2nd option:

root@UCG-Max:/# sed -n 's/shortname=\s*(.)\s/\1/p' /proc/ubnthal/system.info root@UCG-Max:/#

Debug shows the following:

root@UCG-Max:/# sed -n 's/^board.shortname=\s(.)\s/\1/p' /etc/board.info --debug SED PROGRAM: s/^board.shortname=\s\(.\)\s/\1/p INPUT: '/etc/board.info' line 1 PATTERN: board.sysid=0xa69a COMMAND: s/^board.shortname=\s\(.\)\s/\1/p PATTERN: board.sysid=0xa69a END-OF-CYCLE: INPUT: '/etc/board.info' line 2 PATTERN: board.name=UniFi Cloud Gateway Max COMMAND: s/^board.shortname=\s\(.\)\s/\1/p PATTERN: board.name=UniFi Cloud Gateway Max END-OF-CYCLE: INPUT: '/etc/board.info' line 3 PATTERN: board.shortname=UCGMAX COMMAND: s/^board.shortname=\s\(.\)\s/\1/p PATTERN: board.shortname=UCGMAX END-OF-CYCLE: INPUT: '/etc/board.info' line 4 PATTERN: board.subtype= COMMAND: s/^board.shortname=\s\(.\)\s/\1/p PATTERN: board.subtype= END-OF-CYCLE: INPUT: '/etc/board.info' line 5 PATTERN: board.hwaddr=28704E** COMMAND: s/^board.shortname=\s*\(.\)\s/\1/p PATTERN: board.hwaddr=28704E** END-OF-CYCLE: INPUT: '/etc/board.info' line 6 PATTERN: board.reboot=30 COMMAND: s/^board.shortname=\s\(.\)\s/\1/p PATTERN: board.reboot=30 END-OF-CYCLE: INPUT: '/etc/board.info' line 7 PATTERN: board.upgrade=150 COMMAND: s/^board.shortname=\s\(.\)\s/\1/p PATTERN: board.upgrade=150 END-OF-CYCLE: INPUT: '/etc/board.info' line 8 PATTERN: board.phycount=1 COMMAND: s/^board.shortname=\s\(.\)\s/\1/p PATTERN: board.phycount=1 END-OF-CYCLE: INPUT: '/etc/board.info' line 9 PATTERN: board.required_fw_version=0.0.1 COMMAND: s/^board.shortname=\s\(.\)\s/\1/p PATTERN: board.required_fw_version=0.0.1 END-OF-CYCLE: INPUT: '/etc/board.info' line 10 PATTERN: board.cpurevision=0x1023d0e1 COMMAND: s/^board.shortname=\s*\(.\)\s/\1/p PATTERN: board.cpurevision=0x1023d0e1 END-OF-CYCLE: root@UCG-Max:/#

And

root@UCG-Max:/# sed -n 's/shortname=\s(.)\s/\1/p' /proc/ubnthal/system.info --debug SED PROGRAM: s/shortname=\s\(.\)\s/\1/p INPUT: '/proc/ubnthal/system.info' line 1 PATTERN: cpu=Miami 1.1 COMMAND: s/shortname=\s\(.\)\s/\1/p PATTERN: cpu=Miami 1.1 END-OF-CYCLE: INPUT: '/proc/ubnthal/system.info' line 2 PATTERN: cpuid=1023d0e1 COMMAND: s/shortname=\s\(.\)\s/\1/p PATTERN: cpuid=1023d0e1 END-OF-CYCLE: INPUT: '/proc/ubnthal/system.info' line 3 PATTERN: flashSize=16777216 COMMAND: s/shortname=\s\(.\)\s/\1/p PATTERN: flashSize=16777216 END-OF-CYCLE: INPUT: '/proc/ubnthal/system.info' line 4 PATTERN: ramsize=18446744071562067968 COMMAND: s/shortname=\s\(.\)\s/\1/p PATTERN: ramsize=18446744071562067968 END-OF-CYCLE: INPUT: '/proc/ubnthal/system.info' line 5 PATTERN: vendorid=0777 COMMAND: s/shortname=\s\(.\)\s/\1/p PATTERN: vendorid=0777 END-OF-CYCLE: INPUT: '/proc/ubnthal/system.info' line 6 PATTERN: systemid=a69a COMMAND: s/shortname=\s\(.\)\s/\1/p PATTERN: systemid=a69a END-OF-CYCLE: INPUT: '/proc/ubnthal/system.info' line 7 PATTERN: shortname=UCGMAX COMMAND: s/shortname=\s\(.\)\s/\1/p PATTERN: shortname=UCGMAX END-OF-CYCLE: INPUT: '/proc/ubnthal/system.info' line 8 PATTERN: boardrevision=15 COMMAND: s/shortname=\s\(.\)\s/\1/p PATTERN: boardrevision=15 END-OF-CYCLE: INPUT: '/proc/ubnthal/system.info' line 9 PATTERN: serialno=28704** COMMAND: s/shortname=\s*\(.\)\s/\1/p PATTERN: serialno=28704e** END-OF-CYCLE: INPUT: '/proc/ubnthal/system.info' line 10 PATTERN: manufid=003d COMMAND: s/shortname=\s\(.\)\s/\1/p PATTERN: manufid=003d END-OF-CYCLE: INPUT: '/proc/ubnthal/system.info' line 11 PATTERN: mfgweek=202434 COMMAND: s/shortname=\s\(.\)\s/\1/p PATTERN: mfgweek=202434 END-OF-CYCLE: INPUT: '/proc/ubnthal/system.info' line 12 PATTERN: qrid=KhqEA2 COMMAND: s/shortname=\s*\(.\)\s/\1/p PATTERN: qrid=KhqEA2 END-OF-CYCLE: INPUT: '/proc/ubnthal/system.info' line 13 PATTERN: eth0.macaddr=28:70:4e::: COMMAND: s/shortname=\s\(.\)\s/\1/p PATTERN: eth0.macaddr=28:70:4e::: END-OF-CYCLE: INPUT: '/proc/ubnthal/system.info' line 14 PATTERN: eth1.macaddr=28:70:4e::: COMMAND: s/shortname=\s\(.\)\s/\1/p PATTERN: eth1.macaddr=28:70:4e::: END-OF-CYCLE: INPUT: '/proc/ubnthal/system.info' line 15 PATTERN: eth2.macaddr=28:70:4e::: COMMAND: s/shortname=\s\(.\)\s/\1/p PATTERN: eth2.macaddr=28:70:4e::: END-OF-CYCLE: INPUT: '/proc/ubnthal/system.info' line 16 PATTERN: eth3.macaddr=28:70:4e::: COMMAND: s/shortname=\s\(.\)\s/\1/p PATTERN: eth3.macaddr=28:70:4e::: END-OF-CYCLE: INPUT: '/proc/ubnthal/system.info' line 17 PATTERN: eth4.macaddr=28:70:4e::: COMMAND: s/shortname=\s*\(.\)\s/\1/p PATTERN: eth4.macaddr=28:70:4e::: END-OF-CYCLE: INPUT: '/proc/ubnthal/system.info' line 18 PATTERN: device.hashid=9083d9f2** COMMAND: s/shortname=\s*\(.\)\s/\1/p PATTERN: device.hashid=9083d9f2** END-OF-CYCLE: INPUT: '/proc/ubnthal/system.info' line 19 PATTERN: device.anonid=19e58ad2-df55-4279-8083- COMMAND: s/shortname=\s\(.\)\s/\1/p PATTERN: device.anonid=19e58ad2-df55-4279-8083-* END-OF-CYCLE: INPUT: '/proc/ubnthal/system.info' line 20 PATTERN: bt0.macaddr=28:70:4e:::* COMMAND: s/shortname=\s\(.\)\s/\1/p PATTERN: bt0.macaddr=28:70:4e:::* END-OF-CYCLE: INPUT: '/proc/ubnthal/system.info' line 21 PATTERN: cpu_rev_id=1023d0e1 COMMAND: s/shortname=\s\(.\)\s/\1/p PATTERN: cpu_rev_id=1023d0e1 END-OF-CYCLE: root@UCG-Max:/#

erikpost commented 2 months ago

This has been fixed with #320 but unfortunately this change has not been released in a new version of udm-iptv yet.

Dubbeldrank commented 2 months ago

This has been fixed with #320 but unfortunately this change has not been released in a new version of udm-iptv yet.

It's been fixed in this one: https://github.com/fabianishere/udm-iptv/issues/338