GithubHelp home page GithubHelp logo

openwrt_knockd's Introduction

Knockd for OpenWrt/LEDE

Tested with LEDE v18.06.1 for ar71xx

Built from latest git version 0.7.8.

Be advised that the upstream project is more or less unmaintained. This does not mean you can't use knockd in production, but to think about it carefully. But if other, modern portknocking solutions feel too cumbersome for you, knockd may exactly be what you need.

About

This is an updates package source for building the latest stable version of knockd for OpenWrt/LEDE.

Initscript and logbuffer compatible config are included.

Precompiled packages

Available here

Building

Install prerequisites (for Debian):

apt-get install build-essential libncurses5-dev gawk git subversion libssl-dev gettext unzip zlib1g-dev file python curl

Get the LEDE source and checkout the latest revision:

git clone https://git.lede-project.org/source.git lede
cd lede
git checkout v18.06.1

Get package for knockd:

git clone https://github.com/milaq/openwrt_knockd.git package/knockd

Build toolchain:
When initially building select your target system and make sure Network -> Firewall -> knockd is selected.

make tools/install
make toolchain/install

In case you didn't built the whole tree before you need to compile libpcap:

make package/libs/libpcap/configure
make package/libs/libpcap/compile

Build the package:

make package/knockd/clean
make package/knockd/download
make package/knockd/compile

Get the built ipk from:

bin/packages/mips_24kc/base/knockd_<VERSION>.ipk

Installing

Install the ipk:
Scp the ipk to /tmp on your LEDE machine and issue a

opkg install /tmp/knockd_<VERSION>.ipk

Change the default configuration:

/etc/config/knockd

Start and enable the deamon:

/etc/init.d/knockd start
/etc/init.d/knockd enable

openwrt_knockd's People

Contributors

milaq avatar tdfkaolli avatar

Stargazers

 avatar Tom Lee avatar  avatar Peter Kling avatar  avatar  avatar  avatar  avatar

Watchers

James Cloos avatar  avatar  avatar  avatar Peter Kling avatar

openwrt_knockd's Issues

Issues with more than three entries

Hi,
I have problems with knockd on Lede 17.01.4. I have a longer config for knockd as I use it to control internet access for different stations in my lan. Here I notice that three configuration entries run fine but a fourth one doesn't see to work. I do have 10 configuration blocks in my config file.

Additionally I notices:

  1. config is expected to be /etc/knockd.conf and not /etc/config/knockd. I guess this is standard path in knockd.
  2. config installed in second packages seems to have a newer format which doesn't seem to be documented anywhere. At least I couldn't find it.

Could you check or is it a problem of the original knockd ?

Thanks,
TDFKAOlli

Example config below:
[options]
logfile = /var/log/knockd.log
interface = br-lan

[Block1]
sequence = 50213,51113,50432
seq_timeout = 5
command = /etc/knockdscript.sh -I A B
tcpflags = syn

[Free1]
sequence = 50432,51113,50213
seq_timeout = 5
command = /etc/knockdscript.sh -D A B
tcpflags = syn

[Block2]
sequence = 43653,32243,49433
seq_timeout = 5
command = /etc/knockdscript.sh -I C D
tcpflags = syn

[Free2]
sequence = 49433,32243,43653
seq_timeout = 5
command = /etc/knockdscript.sh -D C D
tcpflags = syn

[Block3]
sequence = 37598,27584,59256
seq_timeout = 5
command = /etc/knockdscript.sh -I E F
tcpflags = syn

[Free3]
sequence = 59256,27584,37598
seq_timeout = 5
command = /etc/knockdscript.sh -D E F
tcpflags = syn

[Block4]
sequence = 37897,27584,59526
seq_timeout = 5
command = /etc/knockdscript.sh -I G H
tcpflags = syn

[Free4]
sequence = 59526,27584,37897
seq_timeout = 5
command = /etc/knockdscript.sh -D G H
tcpflags = syn

[AllBlock]
sequence = 57763,25576,34345
seq_timeout = 5
command = /etc/knockdscript.sh -I A B C D E F G H
tcpflags = syn

[AllFree]
sequence = 34345,25576,57763
seq_timeout = 5
command = /etc/knockdscript.sh -D A B C D E F G H
tcpflags = syn

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.