<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Syslog on TurboVision</title>
    <link>https://turbovision.in6-addr.net/tags/syslog/</link>
    <description>Recent content in Syslog on TurboVision</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Tue, 21 Apr 2026 14:06:12 +0000</lastBuildDate>
    <atom:link href="https://turbovision.in6-addr.net/tags/syslog/index.xml" rel="self" type="application/rss&#43;xml" />
    
    
    
    <item>
      <title>My D-Channel Syslog Hack and DynDNS Update for the Home Router</title>
      <link>https://turbovision.in6-addr.net/linux/home-router/dchannel-syslog-hack-and-dyndns-for-my-home-router/</link>
      <pubDate>Sun, 09 Apr 2000 00:00:00 +0000</pubDate>
      <lastBuildDate>Sun, 09 Apr 2000 00:00:00 +0000</lastBuildDate>
      <guid>https://turbovision.in6-addr.net/linux/home-router/dchannel-syslog-hack-and-dyndns-for-my-home-router/</guid>
      <description>&lt;p&gt;Now I have one of my favourite hacks on this router.&lt;/p&gt;
&lt;p&gt;The problem was simple: when I am not at home and the line is down, I still want a way to make the box go online. I do not want to call home, let somebody pick up, log in somewhere, and then maybe start the connection. I want a stupid simple trick. If I call the home number, the box should see that and bring the line up.&lt;/p&gt;
&lt;p&gt;But I do not want the caller to pay for the call. That was important for me. The whole trick should work before the call is really answered.&lt;/p&gt;
&lt;h2 id=&#34;what-the-d-channel-gives-me&#34;&gt;What the D-channel gives me&lt;/h2&gt;
&lt;p&gt;With ISDN the D-channel signal comes before the B-channel is really used for the actual call. isdn4linux logs things about incoming calls into syslog. When I noticed that, I got the idea that maybe I do not need some big elegant callback solution. Maybe I can just watch the logs.&lt;/p&gt;
&lt;p&gt;This is exactly what I do.&lt;/p&gt;
&lt;p&gt;I write a small bash script. I am not some shell master. My bash is honestly very small. But for this I only need a few things:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;tail -f&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;grep&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;a loop&lt;/li&gt;
&lt;li&gt;&lt;code&gt;isdnctrl dial ippp0&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;also one &lt;code&gt;wget&lt;/code&gt; call&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That is enough.&lt;/p&gt;
&lt;h2 id=&#34;the-very-small-ugly-core&#34;&gt;The very small ugly core&lt;/h2&gt;
&lt;p&gt;The script watches &lt;code&gt;/var/log/messages&lt;/code&gt; all the time. When an incoming-call line from i4l appears, the script checks if the caller number is one of my allowed numbers. If yes, it triggers the internet connection.&lt;/p&gt;
&lt;p&gt;Something like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt; 1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 8
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 9
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;10
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;11
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;12
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;13
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;14
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;15
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#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/bash
&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;ALLOWED&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;0301234567 01701234567&amp;#34;&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&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;tail -f /var/log/messages &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;while&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;read&lt;/span&gt; line&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;do&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;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$line&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; grep -q &lt;span class=&#34;s2&#34;&gt;&amp;#34;i4l.*incoming\|isdn.*INCOMING&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;||&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;continue&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;caller&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$line&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; grep -o &lt;span class=&#34;s1&#34;&gt;&amp;#39;[0-9]\{6,11\}&amp;#39;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; head -1&lt;span class=&#34;k&#34;&gt;)&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;ok&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;0&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;k&#34;&gt;for&lt;/span&gt; a in &lt;span class=&#34;nv&#34;&gt;$ALLOWED&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;do&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;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;$caller&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;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$a&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;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;ok&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;1&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;k&#34;&gt;done&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;o&#34;&gt;[&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$ok&lt;/span&gt; -eq &lt;span class=&#34;m&#34;&gt;0&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;]&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;continue&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  /usr/sbin/isdnctrl dial ippp0
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  sleep &lt;span class=&#34;m&#34;&gt;8&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  /usr/bin/wget -q -O - &lt;span class=&#34;s2&#34;&gt;&amp;#34;http://example-dyns.invalid/update?host=myrouter&amp;amp;pass=secret&amp;#34;&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;k&#34;&gt;done&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;This is not art. This is not software engineering beauty. But it works.&lt;/p&gt;
&lt;p&gt;When I call the home number from my mobile or from somewhere else, the phone rings, but nobody answers. So the caller does not get charged. The router already sees enough from the D-channel and starts the dial. Then after a few seconds it uses &lt;code&gt;wget&lt;/code&gt; to push the fresh public IP to a small web server and to a dyns provider. The dyns name now points to the current address.&lt;/p&gt;
&lt;p&gt;For me this is so good because it is made from almost nothing. Just log file watching and a few commands.&lt;/p&gt;
&lt;h2 id=&#34;why-the-dyns-update-matters&#34;&gt;Why the dyns update matters&lt;/h2&gt;
&lt;p&gt;The line does not have a permanent public IP. So it is not enough to only bring the connection up. I also need to know what the new address is or have some name that points to it.&lt;/p&gt;
&lt;p&gt;The second part of the hack is therefore the &lt;code&gt;wget&lt;/code&gt; update.&lt;/p&gt;
&lt;p&gt;I push the address to two places:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;one tiny helper page on a web server I have access to&lt;/li&gt;
&lt;li&gt;one dyns provider with a made-up service name and simple update URL&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The dyns side is the practical one. If it updates correctly, then I can use the hostname from outside and I do not care what IP I got this time.&lt;/p&gt;
&lt;p&gt;The helper page is more for me. I can look there and check if the update happened and which address was sent.&lt;/p&gt;
&lt;h2 id=&#34;small-problems-with-this-solution&#34;&gt;Small problems with this solution&lt;/h2&gt;
&lt;p&gt;Of course it is not all perfect.&lt;/p&gt;
&lt;p&gt;First, the exact i4l log format is not always the same. One version writes a line slightly different than another one. So I try a few grep patterns until it catches the right thing and not random noise.&lt;/p&gt;
&lt;p&gt;Second, if the syslog watcher dies, then the trick is dead. So I put it in a small restart loop. Primitive, but enough.&lt;/p&gt;
&lt;p&gt;Third, timing is a bit ugly. If I call and hang up too fast, sometimes the script catches it, sometimes not. If I let it ring a bit longer, it is more reliable. So I learn how long I need to let it ring.&lt;/p&gt;
&lt;p&gt;Fourth, &lt;code&gt;wget&lt;/code&gt; should not run too early. First the line must be really up. So I just sleep some seconds before the update call. This is exactly the kind of ugly timing thing which I do not love, but it is still better than no solution.&lt;/p&gt;
&lt;h2 id=&#34;why-i-like-this-hack-so-much&#34;&gt;Why I like this hack so much&lt;/h2&gt;
&lt;p&gt;I think the reason is: this is one of the first times I make the machine do something clever only with things I already have.&lt;/p&gt;
&lt;p&gt;No new hardware.
No expensive software.
No giant daemon.
No telephony box.&lt;/p&gt;
&lt;p&gt;Only:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Linux&lt;/li&gt;
&lt;li&gt;syslog&lt;/li&gt;
&lt;li&gt;bash&lt;/li&gt;
&lt;li&gt;i4l log messages&lt;/li&gt;
&lt;li&gt;one &lt;code&gt;wget&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is the style of solution I really enjoy. It feels a bit improvised, yes, but it is also very direct. The machine says what happens in the log, I listen to it, and I react.&lt;/p&gt;
&lt;p&gt;Also it makes the router suddenly feel more &amp;ldquo;alive&amp;rdquo;. It is not only a passive box anymore. It reacts to the outside world in a small smart way.&lt;/p&gt;
&lt;h2 id=&#34;other-changes-around-this-time&#34;&gt;Other changes around this time&lt;/h2&gt;
&lt;p&gt;I also moved the router from SuSE 5.3 to SuSE 6.4 by now. That means kernel 2.2 and &lt;code&gt;ipchains&lt;/code&gt; instead of &lt;code&gt;ipfwadm&lt;/code&gt;. This is good for the LAN side because helpers like &lt;code&gt;ip_masq_ftp&lt;/code&gt; are there and some ugly protocol stuff becomes less ugly.&lt;/p&gt;
&lt;p&gt;So the box now looks already more grown-up than in the first phase:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;SuSE 6.4&lt;/li&gt;
&lt;li&gt;kernel 2.2&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ipchains&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;ISDN dial on demand&lt;/li&gt;
&lt;li&gt;syslog trigger hack&lt;/li&gt;
&lt;li&gt;dyns update with &lt;code&gt;wget&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And still the DSL modem LED is blinking.&lt;/p&gt;
&lt;p&gt;I think this is the most absurd thing: the software side gets more and more finished while the modem still sits there and says &amp;ldquo;not yet&amp;rdquo;.&lt;/p&gt;
&lt;h2 id=&#34;next-things-i-want&#34;&gt;Next things I want&lt;/h2&gt;
&lt;p&gt;The next obvious step is more local services.&lt;/p&gt;
&lt;p&gt;I want:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;local DNS caching&lt;/li&gt;
&lt;li&gt;maybe DHCP from the router&lt;/li&gt;
&lt;li&gt;maybe a web proxy because the line is still not exactly fast&lt;/li&gt;
&lt;li&gt;some ad filtering because web pages are getting more annoying and bigger&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Especially the proxy idea is attractive. If the same stupid banner loads ten times, then I pay for the same stupidity ten times. This is not acceptable.&lt;/p&gt;
&lt;p&gt;So probably the next article is about making the LAN side more comfortable and maybe a bit less wasteful.&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>
