Configuring IPTV in OpenWRT Asus RT-N13U

Faced a firmware problem on my router. I didn’t want to work stably. As a result, having tried a bunch of different firmware, I settled on OpenWRT. For those who want to install, follow here .

So, I digress. My provider provides access to IPTV, so occasionally at work I turn on myself some of the TV shows. Having switched to this firmware, I noticed that there is no standard UDP-HTTP setting in it. Therefore, he began to dig a runet for something that would help me in this situation. As a result, I came across an article Silver_Clash "Configuring IPTV in OpenWRT" , but I couldn’t do anything using the described method. Fumbling until 5 in the morning and finding the cherished lines in the comments, I launched it. Now I want to share the instruction with readers.

First of all, we go to your router via ssh as root user. All settings will be made from the console.

Install udpxy:

opkg update
opkg install udpxy

After a successful installation, verify that udpxy starts:

/usr/bin/udpxy

If everything is in order, the command will display the udpxy version and its main options.

Let's move on to the configuration (it was more convenient for me to work with files on the router via the WinSCP application GUI). Open the udpxy settings file (as you prefer, but I will write for those who work in putty):

vi /etc/config/udpxy 

* if a new version is installed, the option of changing the name of the settings file is possible, then the command will look like this:

 vi /etc/config/udpxy-opkg
*
Most likely, you will see something like this:

config udpxy
	option verbose '0'
	option status '1'
	# option bind '0.0.0.0'
	option port '4022'
	# option source '0.0.0.0'
	# option max_clients '5'
	# option log_file '/var/log/udpxy'
	# option buffer_size '4096'
	# option buffer_messages '-1'
	# option buffer_time '-1'
	# option nice_increment '0'
	# option mcsub_renew '0'

Here you need to change (or leave it as it is) the port on which udpxy will be spinning.

Have you changed? Then we go further.

We start the encoder with the command:

/etc/init.d/udpxy start

You can check if udpxy has started using the command:

ps |grep udpxy

If you see only one line as a result, go back to the settings and check what you did wrong. If everything is correct, you will see something like:

 2035 root       844 S    /usr/bin/udpxy -T -p 4022 -S
 2158 root      1476 S    grep udpxy


You can open the page 192.168.1.1 : 4022 / status in the browser to verify that everything works.
Now you need to register our startup script at startup.

/etc/init.d/udpxy enable


Now you need to configure the firewall for udp traffic:

config rule
	option src 'wan'
	option proto 'igmp'
	option target 'ACCEPT'
config rule
	option src 'wan'
	option proto 'udp'
	option dest_ip '224.0.0.0/4'
	option target 'ACCEPT'

We add these rules to / etc / config / firewall, then restart the service:

/etc/init.d/firewall restart

There is another problem when there is no prescribed route for multicast (I had this moment critical).
Then add this static route to cron:

@daily route add -net 224.0.0.0/4 dev eth0.2 metric 1

And for reliability, we prescribe in ssh:

route add -net 224.0.0.0/4 dev eth0.2 metric 1

eth0.2 is the interface on which the wan port is attached.

Now you can restart the router itself to make sure that all the necessary services are started, and everything works exactly as we intended.

We take the channel list from the provider and convert all the links as described in the manual to udpxy:

http: // {address}: {port} / {protocol} / {channel_addr}: {channel_port}

That is, if you have specified in the channel list :
udp://@239.77.0.93:1234

Then the output should be:

http://192.168.1.1:4022/udp/239.77.0.93:1234

Thanks for attention.

Also popular now: