-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IPv6 is not supported under this link-layer type #83
Comments
Hi @BitBlit88 , the problem output comes from here: Line 1683 in cb163f1
That means that the sniffer detected an IPv6 IP packet and now tries to handle it. But there is an issue with setting 'ip6' which is checked in the very next line. Line 1684 in cb163f1
Here it is set: Line 1643 in cb163f1
So that the case of 'if(lltype == DLT_EN10MB)'. Anyhow there are two other cases where 'ip6' is not properly set in the 'elseif' cases here: Line 1646 in cb163f1
and here: Line 1649 in cb163f1
I guess you now have one of the ifelse-cases and thereby ip6 pointer is not properly set and knockd bails out with the error logile you have seen. I fixed it in my fork here: |
Hi @TDFKAOlli, your fix works very well. |
@BitBlit88 , |
Hey @BitBlit88 ,
Written here: https://www.tcpdump.org/manpages/pcap_open_live.3pcap.html So it might work that you simply use "any" as interface in the knockd config. (Or you add a config to use any in pcap_open_live()). EDIT: Ah, no, one more change is needed, here: Line 280 in cb163f1
This is fetching the IP-address of the interface, but checks for the interface name. I guess it should be changed so it matched either the interface name or "any" and in both cases fetches the IP-address. |
Hi @TDFKAOlli, you are great! Thanks for pointing this out. I change the line to and modified "knockd.conf" to Now both IPv4 and Ipv6 works. |
No prob, came to my mind just now. Before I thought about parsing a list of interfaces and then spawning several knockds for it so to handle each interface by an own thread... This "any" is much more simpler and would do in most cases I guess. 😄 |
Hello,
I tried to add IPv6 support to my knockd service using knockd version 0.8.
Here is my /etc/knockd.conf:
[options]
UseSyslog
Interface = venet0
[SSH]
sequence = 1234,5678,9012
seq_timeout = 5
start_command = ufw allow from %IP% to any port 22 proto tcp
tcpflags = syn
cmd_timeout = 10
stop_command = ufw delete allow from %IP% to any port 2 proto tcp
and ifconfig:
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 632682 bytes 121494481 (121.4 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 632682 bytes 121494481 (121.4 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
venet0: flags=211<UP,BROADCAST,POINTOPOINT,RUNNING,NOARP> mtu 1500
inet 127.0.0.1 netmask 255.255.255.255 broadcast 0.0.0.0 destination 127.0.0.1
inet6 2a01:xxx:xxx:xxx:xxx:xxx:xxx:xxx prefixlen 128 scopeid 0x0
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 0 (UNSPEC)
RX packets 80663 bytes 6564767 (6.5 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 37029 bytes 15021778 (15.0 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
venet0:0: flags=211<UP,BROADCAST,POINTOPOINT,RUNNING,NOARP> mtu 1500
inet 81.yyy.yyy.yyy netmask 255.255.255.255 broadcast 81.yyy.yyy.yyy destination 81.yyy.yyy.yyy
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 0 (UNSPEC)
If I try to knock via IPv6 I get the following message in syslog:
knockd[23619]: IPv6 is not supported under this link-layer type
Ipv4 doesn't work neither with this configuration.
If I change the config to
[options]
UseSyslog
Interface = venet0:0
Ipv4 works but Ipv6 doesn't because venet0:0 is only bound to an IPv4 address.
How could I get IPv4 and IPv6 get working?
The text was updated successfully, but these errors were encountered: