<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[please be seated!]]></title><description><![CDATA[routing, freifunk, linux and stuff.]]></description><link>https://blog.ohrensessel.net/</link><image><url>https://blog.ohrensessel.net/favicon.png</url><title>please be seated!</title><link>https://blog.ohrensessel.net/</link></image><generator>Ghost 2.38</generator><lastBuildDate>Wed, 22 Oct 2025 03:36:49 GMT</lastBuildDate><atom:link href="https://blog.ohrensessel.net/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[EntertainTV with Turris Omnia [update]]]></title><description><![CDATA[<p>My new provider Telekom offers TV via multicast (IPTV). They call it Entertain or <a href="http://www.telekom.de/zuhause/entertain-tv">EntertainTV</a> (which is the newer version). Here is how I got it to work with my Turris Omnia which is attached to a <a href="http://www.draytek.de/vigor130.html">DrayTek Vigor130</a> VDSL2-Modem. So no provider-supplied hardware involved here. Also, I was not</p>]]></description><link>https://blog.ohrensessel.net/entertaintv-with-turris-omnia/</link><guid isPermaLink="false">5c6564101ca7d700011b764a</guid><category><![CDATA[linux]]></category><category><![CDATA[entertain]]></category><category><![CDATA[iptv]]></category><category><![CDATA[turris omnia]]></category><dc:creator><![CDATA[ohrensessel]]></dc:creator><pubDate>Thu, 16 Feb 2017 09:43:08 GMT</pubDate><media:content url="https://blog.ohrensessel.net/content/images/2017/02/entertain_rules-1.png" medium="image"/><content:encoded><![CDATA[<img src="https://blog.ohrensessel.net/content/images/2017/02/entertain_rules-1.png" alt="EntertainTV with Turris Omnia [update]"><p>My new provider Telekom offers TV via multicast (IPTV). They call it Entertain or <a href="http://www.telekom.de/zuhause/entertain-tv">EntertainTV</a> (which is the newer version). Here is how I got it to work with my Turris Omnia which is attached to a <a href="http://www.draytek.de/vigor130.html">DrayTek Vigor130</a> VDSL2-Modem. So no provider-supplied hardware involved here. Also, I was not willing to pay a monthly fee for a suitable receiver but I want to watch TV via VLC on my computer. By the way, this guide should work on mostly every <a href="https://openwrt.org/">OpenWRT</a>-based router. Interface names might be different though.</p>
<p>Here are some prerequisites/a summary:</p>
<ul>
<li>Watching TV via multicast within my LAN (e.g. by using <a href="https://www.videolan.org/vlc/">VLC</a>), not just from a dedicated Ethernet port on the Turris Omnia (as in some other guides)</li>
<li>PPPoE via VLAN7</li>
<li>Entertain / EntertainTV via VLAN8</li>
<li>eth1 is the WAN-Port</li>
</ul>
<p>In the advanced administration webinterface (or as we normally call it: LuCI) we add a new network interface (go to <em>Network --&gt; Interfaces --&gt; Add new interface...</em>) to our router.</p>
<p><img src="https://blog.ohrensessel.net/content/images/2017/02/entertain_first_step_v3.png" alt="EntertainTV with Turris Omnia [update]"></p>
<p>As shown in the screenshot above, I called it <em>entertain</em>, configured it for <em>DHCP client</em> and, most importantly, configured it to cover VLAN8 on the WAN port (<em>eth1.8</em>).</p>
<p>Next on our list is the firewall. Go to <em>Network --&gt; Firewall</em> and add a new zone.</p>
<p><img src="https://blog.ohrensessel.net/content/images/2017/02/entertain_zone.png" alt="EntertainTV with Turris Omnia [update]"></p>
<p>Basically, the settings are the same as for the WAN zone. Obvious difference here is the name (<em>entertain</em>) and the covered network, which is our <em>entertain</em> network interface we just created. For all other zone-related settings, especially within the category <em>Inter-Zone Forwarding</em>, keep the defaults.</p>
<p>As a last step within LuCI, we need to configure some <em>Traffic Rules</em> for our new firewall zone (go to <em>Network --&gt; Firewall --&gt; Traffic Rules</em>).</p>
<p><img src="https://blog.ohrensessel.net/content/images/2017/02/entertain_rules.png" alt="EntertainTV with Turris Omnia [update]"></p>
<p>As you can see, I allowed DHCP, ICMP echo-requests, <a href="https://en.wikipedia.org/wiki/Internet_Group_Management_Protocol">IGMP</a> and multicast traffic. You should be able to add these rules with the data visible in the screenshot above. Always be sure to select <em>entertain</em> as source zone and <em>Device (input)</em> as destination zone (at least for the first three rules). The fourth rule has <em>lan</em> as destination zone and the network <em>224.0.0.0/4</em> as destination address. As Entertain seems to be IPv4-only at the moment (is it really?) I left out the IPv6 counterparts of the rules shown.</p>
<p>Next, install <em>igmpproxy</em> via <em>System --&gt; Software</em>. Don't forget to enable it in <em>System --&gt; Startup</em>.</p>
<p>Of course, all things done until now could also be done via SSH. To not mess up the configuration, I try to use LuCI as long as it gives me all options necessary to accomplish what I want to do. For the next steps, connect via SSH to your router.</p>
<p><em>igmpproxy</em> is configured via the files <code>/etc/config/igmpproxy</code>:</p>
<pre><code>config igmpproxy
        option quickleave 1

config phyint entertain
        option network entertain
        option direction upstream
        list altnet 239.0.0.0/8
        list altnet 217.0.119.194/16
        list altnet 193.158.35.0/24
        list altnet 87.141.128.0/17
        list altnet &lt;your LAN network&gt;

config phyint lan
        option network lan
        option direction downstream
        list altnet &lt;your LAN network&gt;
</code></pre>
<p>Here, we defined an upstream (our <em>entertain</em> interface) and a downstream (our <em>lan</em> interface) network. Several networks are valid sources for IGMP or multicast packets, including our own LAN network (replace <em><your lan network></your></em> with your IPv4 network you use within your LAN, e.g. <em>192.168.0.0/24</em>).</p>
<p>In a <a href="http://wiki.ipfire.org/en/addons/igmpproxy/start">guide from the guys at IPFire</a> I read that it is recommended to explicitly exclude other interfaces in the <em>igmpproxy</em> configuration. As this seems not to be possible via <code>/etc/config/igmpproxy</code>, I added the following lines at the end of the <code>igmp_header()</code> function in <code>/etc/init.d/igmpproxy</code>:</p>
<pre><code>echo &quot;phyint lo disabled&quot; &gt;&gt; /var/etc/igmpproxy.conf
echo &quot;phyint pppoe-wan disabled&quot; &gt;&gt; /var/etc/igmpproxy.conf
echo &quot;phyint eth1.7 disabled&quot; &gt;&gt; /var/etc/igmpproxy.conf
echo &quot;phyint eth1 disabled&quot; &gt;&gt; /var/etc/igmpproxy.conf
echo &quot;phyint ifb4pppoe-wan disabled&quot; &gt;&gt; /var/etc/igmpproxy.conf
</code></pre>
<p>Here you have to see which interfaces are present in your system. Please note that this will probably be overwritten by an update. Do not forget to start <em>igmpproxy</em> afterwards...</p>
<p>Last but not least I enabled <code>igmp_snooping</code> for the <em>lan</em> interface via <code>/etc/config/network</code>. This makes the bridge (<em>br-lan</em>) mutlicast-aware so that packets are not send as broadcasts to your network.</p>
<pre><code>config interface 'lan'
    ...
    option igmp_snooping '1'
    ...
</code></pre>
<p>With this configuration I could watch (multicast) TV via VLC with the playlists provided <a href="http://iptv.blog/artikel/multicastadressliste/">here</a> from my LAN.</p>
<p>My guide is loosely based on <a href="https://forum.openwrt.org/viewtopic.php?id=61160">this</a> and <a href="https://forum.openwrt.org/viewtopic.php?pid=170416#p170416">this</a> and probably some others.</p>
<p><strong>[update]</strong><br>
For multicast to work via WiFi I had to remove the low rates from <code>supported_rates</code> and <code>basic_rate</code> in <code>/etc/config/wireless</code>. I simply removed the lines with the rates <em>6000</em>, <em>9000</em> and <em>12000</em> (bit/s it is) for both radios. This should only be a problem if your WiFi links are very bad.</p>
<p>Otherwise, streams were stuttering.</p>
]]></content:encoded></item><item><title><![CDATA[unbound: responses based on requesting address]]></title><description><![CDATA[<p>We have a specific use-case where requests to our DNS resolver should be answered dependent on the address of the requesting client. Somehow, <a href="https://www.unbound.net/">unbound</a> was giving me hard time when trying to implement that. After asking for help on the <a href="https://open.nlnetlabs.nl/mailman/listinfo/unbound-users">unbound-users</a> mailing list, the necessary configuration <a href="https://unbound.nlnetlabs.nl/pipermail/unbound-users/2016-October/004480.html">got much clearer</a>.</p>
<p>So</p>]]></description><link>https://blog.ohrensessel.net/unbound-responses-based-on-requesting-address/</link><guid isPermaLink="false">5c6564101ca7d700011b7649</guid><category><![CDATA[unbound]]></category><category><![CDATA[dns]]></category><category><![CDATA[linux]]></category><dc:creator><![CDATA[ohrensessel]]></dc:creator><pubDate>Wed, 01 Feb 2017 15:32:29 GMT</pubDate><media:content url="https://blog.ohrensessel.net/content/images/2017/02/unbound.png" medium="image"/><content:encoded><![CDATA[<img src="https://blog.ohrensessel.net/content/images/2017/02/unbound.png" alt="unbound: responses based on requesting address"><p>We have a specific use-case where requests to our DNS resolver should be answered dependent on the address of the requesting client. Somehow, <a href="https://www.unbound.net/">unbound</a> was giving me hard time when trying to implement that. After asking for help on the <a href="https://open.nlnetlabs.nl/mailman/listinfo/unbound-users">unbound-users</a> mailing list, the necessary configuration <a href="https://unbound.nlnetlabs.nl/pipermail/unbound-users/2016-October/004480.html">got much clearer</a>.</p>
<p>So here is a config snippet (which works) for our use case. There are two networks (<em>sued</em> and <em>west</em>) which unbound is serving. Each of them has a specific tag within the configuration file.</p>
<pre><code>server:
define-tag: &quot;sued west&quot;
</code></pre>
<p>Two zones (<em>node.ffhh</em> and <em>knoten.ffhh</em>) are defined which should be handled differently depending on the network from which the request originated. Both tags are assigned to both zones.</p>
<pre><code>local-zone: &quot;node.ffhh.&quot; redirect
local-zone-tag: &quot;node.ffhh.&quot; &quot;sued west&quot;
local-zone: &quot;knoten.ffhh.&quot; redirect
local-zone-tag: &quot;knoten.ffhh.&quot; &quot;sued west&quot;
</code></pre>
<p>For each tag the corresponding networks are defined (IPv4 and IPv6).</p>
<pre><code>access-control-tag: 10.112.64.0/19 &quot;sued&quot;
access-control-tag: 10.112.96.0/19 &quot;west&quot;
access-control-tag: 2a03:2267:1::/48 &quot;sued&quot;
access-control-tag: 2a03:2267:2::/48 &quot;west&quot;
</code></pre>
<p>Afterwards, the <a href="https://en.wikipedia.org/wiki/Domain_Name_System#DNS_resource_records">ressource records</a> served to the clients in the two networks are defined. This now happens for both zones at the same time, which was a little bit confusing for me at the beginning. So one could say that ressource records are assigned to tags, not to zones.</p>
<pre><code>access-control-tag-data: 10.112.64.0/19 &quot;sued&quot; &quot;AAAA 2a03:2267:1::1&quot;
access-control-tag-data: 10.112.64.0/19 &quot;sued&quot; &quot;A 10.112.64.1&quot;
access-control-tag-data: 10.112.96.0/19 &quot;west&quot; &quot;AAAA 2a03:2267:2::1&quot;
access-control-tag-data: 10.112.96.0/19 &quot;west&quot; &quot;A 10.112.96.1&quot;
access-control-tag-data: 2a03:2267:1::/48 &quot;sued&quot; &quot;AAAA 2a03:2267:1::1&quot;
access-control-tag-data: 2a03:2267:1::/48 &quot;sued&quot; &quot;A 10.112.64.1&quot;
access-control-tag-data: 2a03:2267:2::/48 &quot;west&quot; &quot;AAAA 2a03:2267:2::1&quot;
access-control-tag-data: 2a03:2267:2::/48 &quot;west&quot; &quot;A 10.112.96.1&quot;
</code></pre>
<p>Depending on your use case the <em>redirect</em> type at the beginning is not the best choice. Consult the <a href="https://www.unbound.net/documentation/unbound.conf.html">unbound documentation</a> for further types.</p>
]]></content:encoded></item><item><title><![CDATA[pmacct and AS-Stats]]></title><description><![CDATA[<p><a href="https://github.com/manuelkasper/AS-Stats">AS-Stats</a> is a handy tool to visualize traffic on a per-<a href="https://en.wikipedia.org/wiki/Autonomous_system_(Internet)">AS</a> basis. We are making heavy use of it to spot optimization potential regarding traffic from or to our Freifunk Hamburg <a href="https://as49009.peeringdb.com">AS 49009</a>.</p>
<p>In addition to the per-AS graphs showing ingress and egress traffic (separated for IPv4 and IPv6)</p>]]></description><link>https://blog.ohrensessel.net/pmacct-and-as-stats/</link><guid isPermaLink="false">5c6564101ca7d700011b763e</guid><category><![CDATA[statistics]]></category><category><![CDATA[ASN]]></category><category><![CDATA[linux]]></category><dc:creator><![CDATA[ohrensessel]]></dc:creator><pubDate>Thu, 27 Oct 2016 20:33:17 GMT</pubDate><media:content url="https://blog.ohrensessel.net/content/images/2016/10/asstats.png" medium="image"/><content:encoded><![CDATA[<img src="https://blog.ohrensessel.net/content/images/2016/10/asstats.png" alt="pmacct and AS-Stats"><p><a href="https://github.com/manuelkasper/AS-Stats">AS-Stats</a> is a handy tool to visualize traffic on a per-<a href="https://en.wikipedia.org/wiki/Autonomous_system_(Internet)">AS</a> basis. We are making heavy use of it to spot optimization potential regarding traffic from or to our Freifunk Hamburg <a href="https://as49009.peeringdb.com">AS 49009</a>.</p>
<p>In addition to the per-AS graphs showing ingress and egress traffic (separated for IPv4 and IPv6), a graph for each link showing the traffic caused by the top 10 AS (on that link) is generated.</p>
<h2 id="structure">Structure</h2>
<p>We use <a href="http://www.pmacct.net/">pmacct</a> as <a href="https://en.wikipedia.org/wiki/IP_Flow_Information_Export">IPFIX</a> probe (<a href="https://en.wikipedia.org/wiki/NetFlow">NetFlow</a> might be a name you already heard) on the routers (which run bird as routing daemon) handling the traffic we want to visualize. For each network interface, a pmacctd instance is run.</p>
<p><img src="https://blog.ohrensessel.net/content/images/2016/10/pmacct_and_as-stats--1-.png" alt="pmacct and AS-Stats"></p>
<p>Some other host within our AS runs AS-Stats, to which all pmacctd instances are reporting information regarding the traffic sampled by them.</p>
<p>Noteworthy, we let pmacctd do the aggreation per-AS, so that only a counter for egress respective ingress traffic per-AS is sent towards the AS-Stats instance, but no information regarding single flows.</p>
<p>For that pmacct needs to have information regarding the mapping from IP networks to ASs.</p>
<h2 id="pmacct">pmacct</h2>
<p>Probably, it is a good idea to compile <a href="https://github.com/pmacct/pmacct">pmacct from source</a> (not covered here...).</p>
<p>For each interface you want to monitor in AS-Stats, put a config file with the following content in <code>/etc/pmacct/</code> (named e.g. <code>pmacct.1.conf</code>).</p>
<pre><code>interface:&lt;ifname&gt;
nfprobe_source_ip:&lt;ipOfPmacctHost&gt;
daemonize:false
promisc:true
snaplen:200
pre_tag_map:/etc/pmacct/pre_tag.map
plugin_buffer_size:10240
plugin_pipe_size:10240000
sampling_rate:128
aggregate:etype,src_as,dst_as,vlan
nfacctd_as_new:file
networks_file:/var/cache/pmacct/netmap.txt
plugins: nfprobe[a]
nfprobe_version[a]:10
nfprobe_receiver[a]:&lt;asstatsIp&gt;:&lt;asstatsPort&gt;
nfprobe_direction[a]:tag
nfprobe_ifindex[a]:tag2
</code></pre>
<p>Replace <code>&lt;ifname&gt;</code> with the name of the interface to monitor and choose a source IP (<code>&lt;ipOfPmacctHost&gt;</code>) from which to send the IPFIX packets to AS-Stats, reachable at <code>&lt;asstatsIp&gt;:&lt;asstatsPort&gt;</code>.</p>
<p>The <code>aggregate</code> parameter defines that we want to distinguish traffic by <a href="https://en.wikipedia.org/wiki/EtherType">EtherType</a> (<code>0x0800</code> for IPv4 and <code>0x86DD</code> for IPv6), by source and destination AS, and by VLAN (if any). For an explanation of the other config parameters see the quite extensive <a href="http://wiki.pmacct.net/OfficialConfigKeys">pmacct wiki</a>.</p>
<p>Note: We only sample each 128th packet here to reduce CPU load. Depending on the amount of traffic you are seeing you might want to adapt that value (but this has to be equal to the value configured in AS-Stats).</p>
<p>To map traffic to a certain interface for AS-Stats, pmacct has to add a tag (see parameter <code>pre_tag_map</code> above). We do this depending on the source respective destination mac address of the interfaces we are monitoring.</p>
<pre><code>id=1 filter='ether dst &lt;macInterface1&gt;' jeq=nif1
id=2 filter='ether src &lt;macInterface1&gt;' jeq=nif1
id=1 filter='ether dst &lt;macInterface2&gt;' jeq=nif2
id=2 filter='ether src &lt;macInterface2&gt;' jeq=nif2
!
id2=70  label=nif1
id2=80  label=nif2
</code></pre>
<p>Replace the parameters <code>&lt;macInterfaceX&gt;</code> with the mac addresses of the interfaces you are monitoring. Each interfaces has a label (<code>nif1</code> and <code>nif2</code> in this case) which lead to a tag with a certain value (70 and 80 in this case).</p>
<p>Note: Due to laziness, we only have one <code>pre_tag_map</code> for all interfaces holding all the mac addresses.</p>
<h2 id="asstats">AS-Stats</h2>
<p>The corresponding configuration for AS-Stats could look like the following:</p>
<pre><code>&lt;ipOfPmacctHost&gt; 70 link_1 Link 1 ABCDEF  128
&lt;ipOfPmacctHost&gt; 80 link_1 Link 2 FEDCBA  128
</code></pre>
<h2 id="mappingfromipnetworkstoas">Mapping from IP networks to AS</h2>
<p>pmacct needs information regarding the mapping of IP networks to AS. For that, the parameter <code>networks_file</code> gives the path to a file holding tuples of AS and network line by line.</p>
<p>We generate that file by the following, very ugly bash script.</p>
<pre><code>#!/bin/bash

/usr/sbin/birdc sh route primary | gawk 'match($0, /AS([0-9]+)/, ary) \
{ print ary[1] &quot;,&quot; $1 }' | sort -n &gt; /tmp/.birdout
/usr/sbin/birdc6 sh route primary | gawk 'match($0, /AS([0-9]+)/, ary) \
{ print ary[1] &quot;,&quot; $1 }' | sort -n &gt; /tmp/.bird6out

cat /tmp/.birdout &gt; /var/cache/pmacct/netmap.txt
cat /tmp/.bird6out &gt;&gt; /var/cache/pmacct/netmap.txt
</code></pre>
]]></content:encoded></item></channel></rss>