📜 ⬆️ ⬇️

IPTV configuration in TomatoUSB + udpxy


Habré has already addressed the issue of setting up and viewing IPTV through a router on various firmware - openWRT, DDWRT and others, but no one described in detail how to configure IPTV on the Tomato firmware by redirecting the provider’s UDP traffic to TCP client traffic using the udpxy application. In this article, I will describe in detail the process of installing and running udpxy on the firmware tomato v1.28, and I will also tell you how to make the WAN to LAN bridge for a separate IPTV set-top box, because I myself spent a lot of time to figure it all out and be with me at hand a similar article I would have done much faster.
What is udpxy ? The official website of the developers of this application gives us the following wording:
udpxy - server application (daemon) for transferring data from the network multicast channel (broadcast over UDP) to the HTTP connection of the requesting client.
Many may argue that everything works so well if you just turn on multicast in the settings, but in my case watching IPTV via Wi-Fi did not work correctly: the channels were loaded for a long time, the video image froze, the image “scattered”, the Internet started to slow down terribly or disappeared. How should I search the Internet, I did not find clear instructions on how to redirect UDP to TCP on the Tomato firmware, some instructions came up, but they were brief and described the mechanism of operation, and not a specific setting. Many of our compatriots even wrote that this is impossible and you need to install another firmware and tweak it or install firmware that out of the box supports udpxy, but it hurt me that I loved the tomato firmware for its performance, functionality, and understandable, not loaded, interface . In general, I decided to bring the matter to the end and try to figure it out myself and set it up. As a result, this instruction appeared.

Equipment and parameters used in the configuration


Setup Instructions

  1. First, download the necessary files: we will need the “udpxy” application itself, which is suitable for the WNR3500L router, you can download it from here .
  2. We also need the utility “PUTTY” to work with the router via the SSH protocol, download the latest version from here .
  3. We go into the admin panel of the router in the section “Administration” and look for the subsection “Admin Access”; put the checkboxes on “Enable at Startup” and “Remote Access”.
  4. Further in the same section “Administration” we go to the subsection “JFFS” and put a checkmark on “Enable”, then press the “Format / Erase” button and wait for the formatting of the JFFS section.
  5. We press “save” below and then “reboot” on the left (reboot the router).
  6. Open the putty utility, enter the local address of the router (in my case it was 192.168.1.1) and click "open", enter the login " root " and the password that you put on the router, if nothing is changed, then the password should be " admin ".
  7. Now enter the command:
     cd /jffs 
    We press input (go to the folder / jffs).
  8. Next, we need to put the “udpxy” file on the network so that it is available via a direct link - I posted it on rghost.ru , my link turned out to be this:
     http://rghost.ru/download/51607682/5d8db6ffe010a13afdf1cb07ac9b7cd328c693ea/udpxy 
    (for example, we go to rghost.ru, load the file, copy the link to the file, it will be under the “download” button, and continue)
  9. After downloading the udpxy application to our router, being in the /JFFS directory, enter into putty:
     wget http://___udpxy 
    In my case it looked like this:
     wget http://rghost.ru/download/51607518/5c3ff2536e7358f656931ee9f4aef9728c92f1ed/udpxy 
    If the link is correct and the file is downloaded, you will see:
     Connecting to "rghost.ru (217.199.218.100:80)" (      ) udpxy 100% |*******************************| 66067 00:00:00 ETA 
  10. Now we need to give the correct permissions to the file using the command:
     chmod +x udpxy 
  11. Check if our file is in the folder, enter:
     ls 
    If the file is present, you will see its name.
  12. Next, we need to run this application (service) on the router - we do it with the command:
     udpxy -c (-  ) -a ( ip   ) -p (     IPTV) -m ( IP   ) -M (    -) 
    In my case, it looked like this:
     udpxy -c 10 -a 192.168.1.1 -p 7780 -m 93.100.126.169 -M 30 
    If the command is successful after pressing the input, nothing should be swear at the command line.
  13. Now check if our service is working, enter the command:
     s |grep udpxy 
    If the service works, you should see something like:
     634 root 792 S /jffs/udpxy -c 10 -a 192.168.1.1 -p 7780 -m 93.100.126.169 -M 30 671 root 1700 S grep udpxy 
  14. Then to make sure that everything worked 100%, go to the browser and type in the address bar:
     http://_:_/status 
    In my case it was:
     http://192.168.1.1:7780/status 
    If you see the “udpxy status:” page there, then everything works.
  15. We return to putty and prescribe in order the rules for the Firewall, enter:
     iptables -A INPUT -p igmp -j ACCEPT iptables -A INPUT -p udp -m udp -d 224.0.0.0/4 -j ACCEPT 
  16. Now we need to configure the service autostart along with the inclusion of the router, for this we go to the admin panel of the router in the section “Administration” in the subsection “Scripts” in the tab “Init” in the field for text we set the timeout for starting the service and the command that started the udpxy service, in my case it looked like this:
     sleep 30 /jffs/udpxy -c 10 -a 192.168.1.1 -p 7780 -m 93.100.126.169 -M 30 
  17. In the same place, go to the “firewall” tab and enter 2 rules for the Firewall here:
     iptables -A INPUT -p igmp -j ACCEPT iptables -A INPUT -p udp -m udp -d 224.0.0.0/4 -j ACCEPT 
  18. And the last step - we take a playlist with IPTV provider’s channels and edit all of its links (open the notepad, I personally used Akelpad and the “nati and replace” function):
  19. view links
     udp://@ip_: 
    must become a species
     http://192.168.1.1:7780/udp/ip_: 
    In my case it looked like this:
     udp://@239.195.0.73:1234 
    It became so:
     http://192.168.1.1:7780/udp/239.195.0.73:1234 
    save the resulting playlist and close the notebook.
  20. Now you can open our edited playlist with a VLC player for example and check whether everything works, if it works, reboot the router and check it again, if after rebooting it does not work, check items 16 and 17.

Results

We received redirection of UDP traffic from the provider to TCP client traffic, due to this we unloaded the router, got a fast download speed of the video stream and high quality video without fading and spilling the image when viewed on a PC. Everything works fine for me through a wi-fi connection on a laptop, as well as working on the iconbit HDS6L media player, which is connected via LAN to the router. The method is not the easiest, but elegant. Implementing it gave me a lot of pleasure. I really hope that this information is indexed in search engines and will help users who are inexperienced like me.

Posted on 10/24/2015
I finally found the time to buy an IPTV set-top box and then I needed to make a WAN to LAN bridge in order for the set-top box to receive an ip from the provider and start working.
In the admin panel, go to “Utilities” -> “System commands” (for non-Russian version: Tools -> System) and type the following commands in sequence:
  1. First check:
     nvram show | grep vlan.ports 

    We should get an answer:
     vlan1ports=4 3 2 1 8* vlan2ports=0 8 
  2. If the answer matches, execute the commands one after another:
     nvram set manual_boot_nv=1 nvram set vlan1ports="4 3 2 8*" nvram set vlan2ports="0 1 8" nvram commit reboot 
  3. We are waiting for the reboot and check again by executing the command 1.
     nvram show | grep vlan.ports 

    We should get an answer:
     vlan1ports=4 3 2 8* vlan2ports=0 1 8 
  4. We stick in the 4th port of the cable that goes to the console and voila - everything works!

')

Source: https://habr.com/ru/post/209082/


All Articles