Provisioning problem and MAC addresses
Provisioning problem and MAC addresses
Hello all,
I am trying to set up a provisioning server. I managed to make the TVIP to download the firmware from my own server, but I can't manage to make it download settings from the server.
I read the article in wiki.tvip.tv about it, but couldn't do it. I want to make it possible when a TVIP looks up the server for firmware/settings, depending on it's unique MAC address, to download specific xml settings file.
Thank you,
Denyych
I am trying to set up a provisioning server. I managed to make the TVIP to download the firmware from my own server, but I can't manage to make it download settings from the server.
I read the article in wiki.tvip.tv about it, but couldn't do it. I want to make it possible when a TVIP looks up the server for firmware/settings, depending on it's unique MAC address, to download specific xml settings file.
Thank you,
Denyych
Re: Provisioning problem and MAC addresses
Could you, please, explain in more detail what steps you've already completed during server setup process?
What kind of provision server redirect did you use: manual, DNS, DHCP?
I suppose, first you need to have at least all your boxes get one config. When you will have success with that, you can move forward and add MAC-validation.
What kind of provision server redirect did you use: manual, DNS, DHCP?
I suppose, first you need to have at least all your boxes get one config. When you will have success with that, you can move forward and add MAC-validation.
Re: Provisioning problem and MAC addresses
I used manual provision server. I managed to have all the boxes with one config, only the MAC validation is left. Where should I put the code exactly? How will the boxes access their configs? The MAC addresses need to be in database?
Re: Provisioning problem and MAC addresses
If you are talking about example on this document: http://wiki.tvip.ru/en/provisioning
Then, you need to use provided config with NGINX web server.
The template on that page ("/var/www/tvipstb.net/prov.mac/$http_mac_address/") means that you create subdirectories in "prov.mac" named as MAC addresses.
So, if you create config like this: /var/www/tvipstb.net/prov.mac/00:00:00:00:00:01/tvip_provision.xml , it will apply to the STB with MAC address 00:00:00:00:00:01.
Then, you need to use provided config with NGINX web server.
The template on that page ("/var/www/tvipstb.net/prov.mac/$http_mac_address/") means that you create subdirectories in "prov.mac" named as MAC addresses.
So, if you create config like this: /var/www/tvipstb.net/prov.mac/00:00:00:00:00:01/tvip_provision.xml , it will apply to the STB with MAC address 00:00:00:00:00:01.
Re: Provisioning problem and MAC addresses
I use Apache 2 on Debian and I can not deal with the "template".
Re: Provisioning problem and MAC addresses
We only have a ready solution for NGINX.denyych wrote:I use Apache 2 on Debian and I can not deal with the "template".
Basically, you should check "Mac-Address" HTTP header when STB requests XML file and match it to your config. You can do this with PHP, for example.
Re: Provisioning problem and MAC addresses
I ran an NGINX server, it's working now. Can you please give me example config for the MAC filtering?
Re: Provisioning problem and MAC addresses
The example is near the top of that page: http://wiki.tvip.ru/en/provisioningdenyych wrote:I ran an NGINX server, it's working now. Can you please give me example config for the MAC filtering?
You just need to put provided code into
server { ... }
block of your web-site config and change /var/www/tvipstb.net to your actual path to web-site directory.
-
- Posts: 6
- Joined: 23 Nov 2017, 09:56
Re: Provisioning problem and MAC addresses
Hi,
I am working on above configuration, but no luck at this moment
It seems that the variable $http_mac_address is not available on my version of nginx:
---
edwin@ubuntu-dl360:/var/www/html$ nginx -v
nginx version: nginx/1.10.3 (Ubuntu)
---
Or are there any additional configs needed for nginx, besides the 'script' ?
I use this configuration, short version:
server {
... default stuff like servername, root, index, etc
# Make use of MAC-directories for TVIP
if ($http_mac_address) {
set $tvipmac M;
}
if (-d "/var/www/html/prov.mac/$http_mac_address/") {
set $tvipres F$tvipmac;
}
if ($tvipres = FM) {
rewrite ^/prov/(.*)$ /prov.mac/$http_mac_address/$1 break;
}
... rest of stuff aka:
location /prov/*\.xml$ {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
... additional stuff /w php and other locations, but default config from installation
)
when I overrule if-statements, I see a request to the sub-directory, but de MAC-address part is missing:
nginx-config script replaced by:
---
set $tvipmac M;
set $tvipres F$tvipmac;
rewrite ^/prov/(.*)$ /prov.mac/$http_mac_address/$1 break;
---
nginx-logs:
==> /var/log/nginx/access.log <==
192.168.2.4 - - [23/Nov/2017:08:33:59 +0100] "GET /prov/tvip_provision.xml HTTP/1.1" 404 136 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0"
==> /var/log/nginx/error.log <==
2017/11/23 08:33:59 [error] 20658#0: *1 open() "/var/www/html/prov.mac//tvip_provision.xml" failed (2: No such file or directory), client: 192.168.2.4, server: _, request: "GET /prov/tvip_provision.xml HTTP/1.1", host: "ubuntu-dl360"
I think some thing on the used variables is changed, related to the nginx you are using.
Any suggestions ??
I am working on above configuration, but no luck at this moment
It seems that the variable $http_mac_address is not available on my version of nginx:
---
edwin@ubuntu-dl360:/var/www/html$ nginx -v
nginx version: nginx/1.10.3 (Ubuntu)
---
Or are there any additional configs needed for nginx, besides the 'script' ?
I use this configuration, short version:
server {
... default stuff like servername, root, index, etc
# Make use of MAC-directories for TVIP
if ($http_mac_address) {
set $tvipmac M;
}
if (-d "/var/www/html/prov.mac/$http_mac_address/") {
set $tvipres F$tvipmac;
}
if ($tvipres = FM) {
rewrite ^/prov/(.*)$ /prov.mac/$http_mac_address/$1 break;
}
... rest of stuff aka:
location /prov/*\.xml$ {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
... additional stuff /w php and other locations, but default config from installation
)
when I overrule if-statements, I see a request to the sub-directory, but de MAC-address part is missing:
nginx-config script replaced by:
---
set $tvipmac M;
set $tvipres F$tvipmac;
rewrite ^/prov/(.*)$ /prov.mac/$http_mac_address/$1 break;
---
nginx-logs:
==> /var/log/nginx/access.log <==
192.168.2.4 - - [23/Nov/2017:08:33:59 +0100] "GET /prov/tvip_provision.xml HTTP/1.1" 404 136 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0"
==> /var/log/nginx/error.log <==
2017/11/23 08:33:59 [error] 20658#0: *1 open() "/var/www/html/prov.mac//tvip_provision.xml" failed (2: No such file or directory), client: 192.168.2.4, server: _, request: "GET /prov/tvip_provision.xml HTTP/1.1", host: "ubuntu-dl360"
I think some thing on the used variables is changed, related to the nginx you are using.
Any suggestions ??
-
- Posts: 6
- Joined: 23 Nov 2017, 09:56
Re: Provisioning problem and MAC addresses
Sorry, Sorry...
It's working, my test were faulty.
(For those want to know: I tested via a (wifi-)router. so no MAC address is available)
It's working, my test were faulty.
(For those want to know: I tested via a (wifi-)router. so no MAC address is available)