jvinet / knock

A port-knocking daemon
http://www.zeroflux.org/projects/knock
GNU General Public License v2.0
549 stars 113 forks source link

multiple ip address on interface #43

Closed steverweber closed 8 years ago

steverweber commented 8 years ago

we have two ipv4 addrs on an interface x.21 and x.22

root@salt-master-p01-02:~# ip a
1: lo: xxxx
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether z ff:ff:ff:ff:ff:ff
    inet xxx.xxx.xxx.21/24 brd ....255 scope global ens160
       valid_lft forever preferred_lft forever
    inet xxx.xxx.xxx.22/24 scope global secondary ens160
       valid_lft forever preferred_lft forever
    inet6 z/64 scope link 
       valid_lft forever preferred_lft foreve

when we start knockd it selects xxx.xxx.xxx.21 when we need it to use xxx.xxx.xxx.22

root@XXXX:~# knockd -D -v
config: new section: 'options'
config: usesyslog
config: interface: ens160
config: new section: 'SSH'
config: SSH: sequence: XXX
config: tcp flag: SYN
config: SSH: seq_timeout: 10
config: SSH: start_command: /sbin/iptables -I INPUT 1 -s %IP% -p tcp --dport 22 -j ACCEPT
config: SSH: cmd_timeout: 10000
config: SSH: stop_command: /sbin/iptables -D INPUT -s %IP% -p tcp --dport 22 -j ACCEPT
ethernet interface detected
Local IP: xxx.xxx.xxx.21
listening on ens160...

is there any config option to set the ip to use?

thanks

steverweber commented 8 years ago

after reviewing your source and building .... the latest version seem to work. darn ubuntu16.04 is on version 0.5 :(