<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Openwrt on Apuntes de root</title>
    <link>https://blog.099c.org/tags/openwrt/</link>
    <description>Recent content in Openwrt on Apuntes de root</description>
    <generator>Hugo</generator>
    <language>en-US</language>
    <managingEditor>jorti@pm.me (Juan Orti Alcaine)</managingEditor>
    <webMaster>jorti@pm.me (Juan Orti Alcaine)</webMaster>
    <lastBuildDate>Fri, 06 Mar 2026 09:14:09 +0100</lastBuildDate>
    <atom:link href="https://blog.099c.org/tags/openwrt/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Bulwark: block attacking IPs at the router level</title>
      <link>https://blog.099c.org/posts/bulwark-block-attacking-ips-at-router-level/</link>
      <pubDate>Fri, 06 Mar 2026 09:14:09 +0100</pubDate><author>jorti@pm.me (Juan Orti Alcaine)</author>
      <guid>https://blog.099c.org/posts/bulwark-block-attacking-ips-at-router-level/</guid>
      <description>&lt;p&gt;Inspired on Crowdsec firewall bouncer, and also with the intention of learning&#xA;some Rust, I&amp;rsquo;ve created &lt;a href=&#34;https://codeberg.org/jorti/bulwark&#34;&gt;Bulwark&lt;/a&gt;, a small program to run in a OpenWrt router&#xA;(or any Linux machine) to ban IPs of attacks detected by my servers.&lt;/p&gt;</description>
    </item>
    <item>
      <title>IP sets in OpenWrt 22.03</title>
      <link>https://blog.099c.org/posts/ip-sets-in-openwrt-22-03/</link>
      <pubDate>Mon, 26 Sep 2022 00:00:00 +0000</pubDate><author>jorti@pm.me (Juan Orti Alcaine)</author>
      <guid>https://blog.099c.org/posts/ip-sets-in-openwrt-22-03/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://openwrt.org/&#34;&gt;OpenWrt&lt;/a&gt; has recently released version &lt;a href=&#34;https://openwrt.org/releases/22.03/notes-22.03.0&#34;&gt;22.03&lt;/a&gt;, and one of the biggest changes is the switch to nftables.&lt;/p&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve noticed though that nftables doesn&amp;rsquo;t use ipsets as I was used to, but it has a new concept of &lt;a href=&#34;https://wiki.nftables.org/wiki-nftables/index.php/Moving_from_ipset_to_nftables&#34;&gt;sets&lt;/a&gt; inside the nftables ruleset.&lt;/p&gt;&#xA;&lt;p&gt;I wanted to create a firewall rule to filter a list of IPs from an URL, however the integration was not as straightforward as with iptables, so I&amp;rsquo;ve ended creating this solution.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Static DHCPv6 leases in OpenWrt</title>
      <link>https://blog.099c.org/posts/static-dhcpv6-leases-in-openwrt/</link>
      <pubDate>Sun, 07 Sep 2014 00:00:00 +0000</pubDate><author>jorti@pm.me (Juan Orti Alcaine)</author>
      <guid>https://blog.099c.org/posts/static-dhcpv6-leases-in-openwrt/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve updated my router&amp;rsquo;s fimware to latest version of OpenWrt, and there are great improvements everywhere. The one I like more is the overhaul of the IPv6 configuration, with the new daemon &lt;a href=&#34;https://github.com/sbyx/odhcpd&#34; title=&#34;ODHCPD&#34;&gt;odhcpd&lt;/a&gt; and the automatic prefix delegation. You can consult the details in the &lt;a href=&#34;http://wiki.openwrt.org/doc/uci/network6&#34; title=&#34;OpenWrt IPv6&#34;&gt;wiki&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;However, I&amp;rsquo;ve found one caveat trying to configure a client to have a static DHCPv6 lease. After asking in the forums, I found &lt;a href=&#34;https://forum.openwrt.org/viewtopic.php?pid=236272#p236272&#34;&gt;the solution&lt;/a&gt;: First, the client has to obtain an IP by DHCPv6, that way the DUID of the client is registered in &lt;code&gt;/var/hosts/odhcpd&lt;/code&gt;. Then, the DUID has to be added to &lt;code&gt;/etc/config/dhcp&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>IPsec server in OpenWrt (II)</title>
      <link>https://blog.099c.org/posts/ipsec-server-in-openwrt-ii/</link>
      <pubDate>Fri, 07 Mar 2014 00:00:00 +0000</pubDate><author>jorti@pm.me (Juan Orti Alcaine)</author>
      <guid>https://blog.099c.org/posts/ipsec-server-in-openwrt-ii/</guid>
      <description>&lt;p&gt;This is an update of my previous post about &lt;a href=&#34;https://blog.099c.org/posts/ipsec-server-in-openwrt/&#34;&gt;configuring IPsec in OpenWrt&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The network scenario I&amp;rsquo;m describing is a central OpenWrt router with 2 internal LANs, plus 2 external hosts connected with VPN and some roadwarriors with all their traffic redirected through the IPsec tunnel.&lt;/p&gt;</description>
    </item>
    <item>
      <title>IPsec server in OpenWrt</title>
      <link>https://blog.099c.org/posts/ipsec-server-in-openwrt/</link>
      <pubDate>Wed, 01 May 2013 00:00:00 +0000</pubDate><author>jorti@pm.me (Juan Orti Alcaine)</author>
      <guid>https://blog.099c.org/posts/ipsec-server-in-openwrt/</guid>
      <description>&lt;p&gt;&lt;em&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: Please, check &lt;a href=&#34;https://blog.099c.org/posts/ipsec-server-in-openwrt-ii/&#34;&gt;this updated post&lt;/a&gt; about this topic.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;I have configured a IPsec server in my OpenWrt router to use it from my Android device when I am connected to an untrusted network. Previously I&amp;rsquo;ve used OpenVPN, but it drains too much battery, so I want to test if this solution, which is integrated in Android, works better.&lt;/p&gt;&#xA;&lt;p&gt;I have taken the configuration from the &lt;a href=&#34;http://wiki.openwrt.org/inbox/strongswan.howto&#34; title=&#34;StrongSwan howto&#34;&gt;OpenWrt Wiki&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fix failed to prime trust anchor -- DNSKEY rrset is not secure . DNSKEY IN</title>
      <link>https://blog.099c.org/posts/fix-failed-to-prime-trust-anchor-dnsskey-rrset-is-not-secure-dnsskey-in/</link>
      <pubDate>Mon, 14 Jan 2013 00:00:00 +0000</pubDate><author>jorti@pm.me (Juan Orti Alcaine)</author>
      <guid>https://blog.099c.org/posts/fix-failed-to-prime-trust-anchor-dnsskey-rrset-is-not-secure-dnsskey-in/</guid>
      <description>&lt;p&gt;After &lt;a href=&#34;https://blog.099c.org/posts/configure-unbound-dnssec-resolver-in-openwrt/&#34;&gt;installing Unbound in a OpenWrt router&lt;/a&gt;, I noticed that afer a reboot, the DNS was not working. I saw many of these errors in the log:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;failed to prime trust anchor -- DNSKEY rrset is not secure . DNSKEY IN&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I have discovered that the system date was wrong. As this device lacks a hardware clock, when the machine boots, it cannot synchronize the time by NTP because there is no resolver (Unbound doesn&amp;rsquo;t start because the date validation of the ICANN certificate fails). It&amp;rsquo;s a chicken or the egg problem.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Configure Unbound DNSSEC resolver in OpenWrt</title>
      <link>https://blog.099c.org/posts/configure-unbound-dnssec-resolver-in-openwrt/</link>
      <pubDate>Thu, 20 Dec 2012 00:00:00 +0000</pubDate><author>jorti@pm.me (Juan Orti Alcaine)</author>
      <guid>https://blog.099c.org/posts/configure-unbound-dnssec-resolver-in-openwrt/</guid>
      <description>&lt;p&gt;After realizing that my ISP (ONO) was hijacking the NXDOMAIN DNS responses, I decided to improve the security of the DNS queries for my entire LAN using &lt;a href=&#34;https://en.wikipedia.org/wiki/Domain_Name_System_Security_Extensions&#34; title=&#34;DNSSEC&#34;&gt;DNSSEC&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I choosed to replace &lt;a href=&#34;http://www.thekelleys.org.uk/dnsmasq/doc.html&#34; title=&#34;dnsmasq&#34;&gt;dnsmasq&lt;/a&gt; for &lt;a href=&#34;https://unbound.net/&#34; title=&#34;unbound&#34;&gt;unbound&lt;/a&gt; in my OpenWrt router. These are the steps I followed.&lt;/p&gt;&#xA;&lt;p&gt;First I installed the required packages:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;# opkg update # opkg install unbound unbound-anchor unbound-control unbound-control-setup unbound-host&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;As dnsmasq is also the DHCP server, I&amp;rsquo;m not going to disable it, only change the DNS port to 5353. In &lt;code&gt;/etc/config/dhcp&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>proxy.pac CGI script</title>
      <link>https://blog.099c.org/posts/proxy-pac-cgi-script/</link>
      <pubDate>Mon, 23 Jul 2012 00:00:00 +0000</pubDate><author>jorti@pm.me (Juan Orti Alcaine)</author>
      <guid>https://blog.099c.org/posts/proxy-pac-cgi-script/</guid>
      <description>&lt;p&gt;In my OpenWrt box I have two internal networks,one for my LAN and other for the wifi guests. I have configured a proxy server, and to distribute the configuration to the clients, I did a little script to generate a &lt;code&gt;proxy.pac&lt;/code&gt; file dependent on the client IP.&lt;/p&gt;&#xA;&lt;p&gt;I have this in &lt;code&gt;/www/cgi-bin/proxy.pac&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cp&#34;&gt;#!/bin/sh&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nv&#34;&gt;mynetmask&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;255.255.255.0&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;eval&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;/bin/ipcalc.sh &lt;span class=&#34;nv&#34;&gt;$REMOTE_ADDR&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$mynetmask&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$NETWORK&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;192.168.10.0&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;then&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nv&#34;&gt;proxy&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;PROXY 192.168.10.1:3128&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; DIRECT&lt;span class=&#34;s2&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;else&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;nv&#34;&gt;proxy&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;PROXY 192.168.11.1:3128&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; DIRECT&lt;span class=&#34;s2&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; Content-Type: application/x-ns-proxy-autoconfig&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;function FindProxyForURL(url, host)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s2&#34;&gt;{&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s2&#34;&gt;  return &lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$proxy&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s2&#34;&gt;}&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Make it executable, you can test it in command line passing the client IP:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
