본문 바로가기
Network/UniFi

UniFi OS에서 UDR IPTV 설정하기(LG U+)

by miumida 2022. 1. 24.

처음에 의도했던 mories76/udmprose-iptv 깃허브 내용으로 따라하진 않았다.

그래도 열심히 정리한 부분이니깐 그대로 KEEP. 혹시나 나중에 또 쓸일이 있을지도 모르니.

 

네이버 Fibaro 카페의 minsad님께서 어차피 UDM, UDR이 UniFi OS가 같다고 이야기 하셔서,

UDM 설정을 그대로 따라 하니깐 된다-_-;; 같은 OS니깐 당연히 되야하는건가 싶지만.

 

6. igmpproxy.conf 수정

깃허브에는 eth9로 UDM에서는 eth8로 세팅으로 되어 있었지만

UDR은 포트가 다르기 때문에 eth4로 변경해주니 되었다.

여기서 eth4가 WAN이라고 생각하면 된다.

quickleave

# upstream = modem interface
phyint eth4 upstream ratelimit 0 threshold 1
        altnet 0.0.0.0/0;

# lan interface of iptv device
phyint br2 downstream ratelimit 0 threshold 1
        altnet 0.0.0.0/0;

# disable all unused interfaces
phyint lo disabled
phyint eth4 disabled

▶ mories76/udmprose-iptv 깃허브 내용 정리

① Requiremensts

: UDM PRO SE나 UDR은 igmpproxy/multicastrouting을 지원하는 커널버전에서 작업되어야 한다.

- 2021년 12월 초 기준 조기 액세스 펌웨어 2.3.7이 필요

- fabianishere/udm-iptv 깃허브에서 "Setting up Internet Connection"과 "Configuring Internal LAN"

  내용을 읽고 내용을 충분히 숙지 또는 이해필요

 

GitHub - fabianishere/udm-iptv: Helper tool for configuring IPTV on the UniFi Dream Machine (Pro)

Helper tool for configuring IPTV on the UniFi Dream Machine (Pro) - GitHub - fabianishere/udm-iptv: Helper tool for configuring IPTV on the UniFi Dream Machine (Pro)

github.com

 

- GUI를 통해 별도로 생성된 네트워크를 원하는 스위치 포트에 할당한다.

  . LAN-IPTV라는 이름으로 서브넷이 192.168.2.0/24인 새 네트워크 생성

  . 장치의 포트4를 사용하고 Unifi 장치에서 UDMSE/UDR을 활성화

  . 포트4의 설정에서 포트 프로필을 "LAN-IPTV"로 설정하고 저장

 

- 추가정보

  . 환경변수 설정에서 필요하기 때문에 확인하여 메모가 필요( IPTV_LAN_INTERFACES or br# )

  . SSH로 콘솔에 접속하여 ifconfig 명령어로 출력되는 목록에서 inet 값에서 서브넷을 확인.

Environmental Variable Description Default
IPTV_WAN_INTERFACE Interface on which IPTV traffic enters the router eth8 (on UDM Pro) or eth4 (on UDM)
IPTV_WAN_RANGES IP ranges from which the IPTV traffic originates
(separated by spaces)
213.75.0.0/16 217.166.0.0/16
IPTV_WAN_VLAN ID of VLAN which carries IPTV traffic
(use 0 if no VLAN is used)
4
IPTV_WAN_VLAN_INTERFACE Name of the VLAN interface to be created iptv
IPTV_WAN_DHCP_OPTIONS DHCP options to send when requesting an IP address -O staticroutes -V IPTV_RG
IPTV_LAN_INTERFACES Interfaces on which IPTV should be made available br0

 

 

Download and copy podman installation archive to UDM PRO SE

: 아래 단계는 컴퓨터에서 수행해야 함.

- 아래 링크에서 udmse-podman-install.zip 최신 파일을 PC에 다운로드

 

GitHub - boostchicken-dev/udm-utilities: A collection of things I have made to make the Unifi Dream Machine more useful

A collection of things I have made to make the Unifi Dream Machine more useful - GitHub - boostchicken-dev/udm-utilities: A collection of things I have made to make the Unifi Dream Machine more useful

github.com

- udmse-podman-install.zip을 UDM PRO SE의 /tmp 폴더에 복사

scp ~/Downloads/udmse-podman-install.zip root@192.168.1.1:/tmp/

 

 

③ Create persistent folder

: 여기에서 모든 단계는 SSH를 통해 장치에서 수행.

- UDM PRO SE 및 UDR의 파일 시스템은 펌웨어 업그레이드 중에 기본값으로 재설정됨.

- 업그레이드 시, 복구하기 위해 해당 경로로 /opt/iptv에 폴더 생성

- 이 폴더에는 iptv 컨테이너를 실행하는데 필요한 podman 소프트웨어와 구성 파일이 들어 있음

mkdir -p /opt/iptv

 

 

④ Extract zip file

- /tmp/podman 경로에 zip 파일 압축해제

unzip /tmp/udmse-podman-install.zip -d /tmp/podman

- /opt/iptv/podman-install 경로에 zip 파일 압축해제

unzip /tmp/podman/podman-install.zip -d /opt/iptv/podman-install

 

 

⑤ Download cni drivers

- boostchickens udm-utilities repository에 스크립트를 사용하여 cni 드라이버 설치

- /opt/cni/bin 경로에 설치됨.

sh -c "$(curl -s https://raw.githubusercontent.com/boostchicken/udm-utilities/master/cni-plugins/05-install-cni-plugins.sh)"

 

 

⑥ Create additional config files in /opt/iptv/etc/containers

: repo에서 아래 파일을 다운로드

   . policy.json

   . registries.conf

   . storage.conf

wget https://raw.githubusercontent.com/mories76/udmprose-iptv/main/policy.json -P /opt/iptv/etc/containers
wget https://raw.githubusercontent.com/mories76/udmprose-iptv/main/registries.conf -P /opt/iptv/etc/containers
wget https://raw.githubusercontent.com/mories76/udmprose-iptv/main/storage.conf -P /opt/iptv/etc/containers

 

 

⑦ Change containers.conf

: 아래 명령을 사용하여 containers.conf에 log_driver 값을 추가

sed -i '/^log_size_max=.*/i log_driver="journald"' /opt/iptv/podman-install/etc/containers/containers.conf

- /opt/iptv/etc/containers/containers.conf 파일에서 명령어 수행 후에 아래와 같아야함

[containers]
cgroups="no-conmon"
pidns="private"
pids_limit=0
log_driver="journald"
log_size_max=104857600

 

 

⑧ Copy install folder to root

: root 경로로 파일 복사

cp -r /opt/iptv/podman-install/* /

 

 

⑨ Set environment variables

- /opt/iptv/iptv.env 환경설정 파일을 생성

- repo에서 파일을 다운로드하여 사용할 수 있음

wget https://raw.githubusercontent.com/mories76/udmprose-iptv/main/policy.json -P /opt/iptv/iptv.env

- 필요에 따라 파일 수정이 필요할 수 있음

vi /opt/iptv/iptv.env

- UDR의 일반적인 설정은 아래와 같음.

export IPTV_WAN_INTERFACE="eth4"
export IPTV_WAN_RANGES="224.0.0.0/4"
export IPTV_WAN_VLAN="2"
export IPTV_WAN_VLAN_INTERFACE="iptv"
export IPTV_WAN_DHCP_OPTIONS="-O staticroutes -V IPTV_RG"
export IPTV_LAN_INTERFACES="br2"
export IPTV_LAN_RANGES=""
export IPTV_IGMPPROXY_ARGS=""

- 환경변수 설정

. /opt/iptv/iptv.env

 

 

⑩ Copy podman software

- podman을 파일시스템 root에 복사

cp -r /opt/iptv/podman-install/* /

- 아래 명령어를 실행하여 podman 확인

podman info

 

 

ⓐ Create container

: 컨테이너 생성

podman create --network=host --privileged \
    --name iptv -i --restart on-failure:5 \
    -e IPTV_WAN_INTERFACE="$IPTV_WAN_INTERFACE" \
    -e IPTV_WAN_RANGES="$IPTV_WAN_RANGES" \
    -e IPTV_WAN_VLAN="$IPTV_WAN_VLAN" \
    -e IPTV_WAN_DHCP_OPTIONS="$IPTV_WAN_DHCP_OPTIONS" \
    -e IPTV_LAN_INTERFACES="$IPTV_LAN_INTERFACES" \
    -e IPTV_LAN_RANGES="" \
    fabianishere/udm-iptv $IPTV_IGMPPROXY_ARGS

 

 

ⓑ Run podman as a service

iptv 컨테이너가 부팅시 시작할 수 있도록 systemd 서비스 단위파일 생성

podman generate systemd --restart-policy=always iptv > /etc/systemd/system/iptv.service

부팅시 서비스 시작 활성화

systemctl enable iptv

이전 명령이 성공했는지 확인하고 iptv.service를 찾기.

systemctl list-unit-files --type service

서비스 시작

systemctl start iptv

서비스 상태 확인

systemctl status iptv

 

 

ⓒ Firmware updates

서비스 중지

systemctl disable iptv

기존 컨테이너 모두 중지

podman container stop -a

기존 컨테이너 전체 정리 - 중지된 모든 컨테이너를 제거

podman system prune -fa

펌웨어 업데이트 후, 파일 시스템의 특정 부분이 overlayfs로 인해 재설정됨
/etc 폴더는 삭제되지 않고 남아 있음.

/usr/bin 및 /usr/libexec의 podman 관련 내용은 삭제됨.

/etc/containers의 구성 파일은 여전히 ​​존재.

cp -r /opt/iptv/podman-install/* /
. /opt/iptv/iptv.env
podman create --network=host --privileged \
    --name iptv -i --restart on-failure:5 \
    -e IPTV_WAN_INTERFACE="$IPTV_WAN_INTERFACE" \
    -e IPTV_WAN_RANGES="$IPTV_WAN_RANGES" \
    -e IPTV_WAN_VLAN="$IPTV_WAN_VLAN" \
    -e IPTV_WAN_DHCP_OPTIONS="$IPTV_WAN_DHCP_OPTIONS" \
    -e IPTV_LAN_INTERFACES="$IPTV_LAN_INTERFACES" \
    -e IPTV_LAN_RANGES="" \
    fabianishere/udm-iptv $IPTV_IGMPPROXY_ARGS
podman generate systemd --restart-policy=always iptv > /etc/systemd/system/iptv.service
systemctl enable iptv

 


[ UDR ]

 

GitHub - mories76/udmprose-iptv

Contribute to mories76/udmprose-iptv development by creating an account on GitHub.

github.com

 

 

[ UDM ]

 

UDM PRO (with IPTV) 설정기

대한민국 모임의 시작, 네이버 카페

cafe.naver.com

 

unifi 에서 애플티비 skb btv 보기 : 클리앙

unifi udm pro와 애플티비 btv 를 사용하고 있습니다만 소스를 any, any와 멀티캐스트를 전체대역으로허용 했기 때문에 아마 다른 iptv 도 작동할것으로 생각합니다 USG는 https://www.itkairos.com/159 를 참고

m.clien.net

 

 

[ USG ]

 

유비쿼티네트웍스_UniFi Security Gateway(USG)에서 SKB/LG U+ IPTV 설정

*SKB IPTV에서 정상작동 확인(2021.06.19) WAN1은 인터넷 메인 IN LAN1은 하단 스위치에 연결해 각종 장비와 연결, LAN2는 tvG 4K 셋탑과 연결되는 구성으로 설명합니다. 1. Setting > Networks > Create New Netw..

www.itkairos.com

 

댓글