LINUX.ORG.RU

Ответ на: комментарий от biglpfan
root@srv9315:/host# apt install xtables-addons-dkms
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package xtables-addons-dkms

sources.list

# deb http://ftp.ru.debian.org/debian buster main

deb http://ftp.ru.debian.org/debian buster main
deb-src http://ftp.ru.debian.org/debian buster main

deb http://security.debian.org/debian-security buster/updates main
deb-src http://security.debian.org/debian-security buster/updates main

# buster-updates, previously known as 'volatile'
deb http://ftp.ru.debian.org/debian buster-updates main
deb-src http://ftp.ru.debian.org/debian buster-updates main
deb-src http://ftp.us.debian.org/debian unstable main

User01 ()
Ответ на: комментарий от biglpfan
root@srv9315:/host# update-alternatives --display iptables
iptables - auto mode
  link best version is /usr/sbin/iptables-nft
  link currently points to /usr/sbin/iptables-nft
  link iptables is /usr/sbin/iptables
  slave iptables-restore is /usr/sbin/iptables-restore
  slave iptables-save is /usr/sbin/iptables-save
/usr/sbin/iptables-legacy - priority 10
  slave iptables-restore: /usr/sbin/iptables-legacy-restore
  slave iptables-save: /usr/sbin/iptables-legacy-save
/usr/sbin/iptables-nft - priority 20
  slave iptables-restore: /usr/sbin/iptables-nft-restore
  slave iptables-save: /usr/sbin/iptables-nft-save
root@srv9315:/host#

С тестового есть пакет, но он походу там сколько всего наобновляет что будут проблемы, уже пробовал час назад, пришлось перебивать ос, т.к даже ssh наобновляло так что зайти не смог

User01 ()
Последнее исправление: User01 (всего исправлений: 1)
Ответ на: комментарий от User01

в 10 начинается переход с iptables на nftables (и вот у вас уже используется обертка над последним). Для того, чтобы продолжать использовать iptables старый и модули xtables-addons надо будет первым делом переключиться на iptables-legacy. Я не уверен, что с nft эти модули вообще будут работать.

Второй, более правильный вариант, как мне кажется - переписать фаервол на nftables, отказаться от iptables совсем. GeoIP для nftables тут - https://github.com/pvxe/nftables-geoip

Да, этот вариант длиннее и сложнее, но iptables будут закапывать все дальше и глубже, в дальнейшем начнут всплывать какие-нибудь другие проблемы.

biglpfan ()

https://www.reddit.com/r/debian/comments/d6mnsa/firewall_with_geoip_capabilit...

sudo apt install xtables-addons-common libnet-cidr-lite-perl libtext-csv-xs-perl libgeoip2-perl

sudo modprobe xt_geoip

#Enable geoip after reboot as well

echo "xt_geoip" | sudo tee -a /etc/modules-load.d/xt_geoip

#Download geoip files

mkdir /tmp/geoip
cd /tmp/geoip
/usr/src/xtables-addons-3.2/geoip/xt_geoip_dl

#Build geoip database

sudo mkdir -p /usr/share/xt_geoip
cd GeoLite2-Country-CSV_20190709
sudo /usr/src/xtables-addons-3.2/geoip/xt_geoip_build -D /usr/share/xt_geoip
vtVitus ★★★★★ ()
Ответ на: комментарий от vtVitus
root@srv9315:~# apt install xtables-addons-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package xtables-addons-common is not available, but is referred to by another pa                                                                                        ckage.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'xtables-addons-common' has no installation candidate
root@srv9315:~#

User01 ()
Ответ на: комментарий от User01

пошел другим путём https://habr.com/ru/company/selectel/blog/511392/

root@srv9315:~/xtables-addons-xtables-addons# ./autogen.sh
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
libtoolize: copying file 'build-aux/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
configure.ac:7: installing 'build-aux/compile'
configure.ac:6: installing 'build-aux/missing'
Makefile.am:6: warning: ':='-style assignments are not portable
Makefile.am:21: warning: ':='-style assignments are not portable
Makefile.am:21: warning: shell mktemp -dtu: non-POSIX variable name
Makefile.am:21: (probably a GNU make extension)
extensions/ACCOUNT/Makefile.am: installing 'build-aux/depcomp'
root@srv9315:~/xtables-addons-xtables-addons#
root@srv9315:~/xtables-addons-xtables-addons# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking for ar... ar
checking the archiver (ar) interface... ar
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking linux/netfilter/x_tables.h usability... yes
checking linux/netfilter/x_tables.h presence... yes
checking for linux/netfilter/x_tables.h... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for libxtables... yes
checking Xtables module directory... /usr/lib/x86_64-linux-gnu/xtables
checking kernel version that we will build against... make: *** /lib/modules/4.19.0-13-amd64/build: No such file or directory.  Stop.
0.0.0.0 in /lib/modules/4.19.0-13-amd64/build
WARNING: That kernel version is not officially supported.
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating Makefile.iptrules
config.status: creating Makefile.mans
config.status: creating geoip/Makefile
config.status: creating extensions/Makefile
config.status: creating extensions/ACCOUNT/Makefile
config.status: creating extensions/pknock/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
root@srv9315:~/xtables-addons-xtables-addons#

и тут полезли ошибки

User01 ()
Ответ на: комментарий от User01

*** /lib/modules/4.19.0-13-amd64/build: No such file or directory. Stop.


vitus@vthome:~$ ll /lib/modules/4.19.0-13-amd64/
итого 4448
drwxr-xr-x 12 root root    4096 дек  6 15:13 kernel
-rw-r--r--  1 root root 1131401 дек  6 15:13 modules.alias
-rw-r--r--  1 root root 1078370 дек  6 15:13 modules.alias.bin
-rw-r--r--  1 root root    4683 ноя 28 10:47 modules.builtin
-rw-r--r--  1 root root    5999 дек  6 15:13 modules.builtin.bin
-rw-r--r--  1 root root  434780 дек  6 15:13 modules.dep
-rw-r--r--  1 root root  592745 дек  6 15:13 modules.dep.bin
-rw-r--r--  1 root root     456 дек  6 15:13 modules.devname
-rw-r--r--  1 root root  140056 ноя 28 10:47 modules.order
-rw-r--r--  1 root root     800 дек  6 15:13 modules.softdep
-rw-r--r--  1 root root  507205 дек  6 15:13 modules.symbols
-rw-r--r--  1 root root  626064 дек  6 15:13 modules.symbols.bin

vitus@vthome:~$ sudo apt install linux-headers-$(uname -r)

...

vitus@vthome:~$ ll /lib/modules/4.19.0-13-amd64/
итого 4448
lrwxrwxrwx  1 root root      38 ноя 28 10:47 build -> /usr/src/linux-headers-4.19.0-13-amd64
drwxr-xr-x 12 root root    4096 дек  6 15:13 kernel
-rw-r--r--  1 root root 1131401 дек  6 15:13 modules.alias
-rw-r--r--  1 root root 1078370 дек  6 15:13 modules.alias.bin
-rw-r--r--  1 root root    4683 ноя 28 10:47 modules.builtin
-rw-r--r--  1 root root    5999 дек  6 15:13 modules.builtin.bin
-rw-r--r--  1 root root  434780 дек  6 15:13 modules.dep
-rw-r--r--  1 root root  592745 дек  6 15:13 modules.dep.bin
-rw-r--r--  1 root root     456 дек  6 15:13 modules.devname
-rw-r--r--  1 root root  140056 ноя 28 10:47 modules.order
-rw-r--r--  1 root root     800 дек  6 15:13 modules.softdep
-rw-r--r--  1 root root  507205 дек  6 15:13 modules.symbols
-rw-r--r--  1 root root  626064 дек  6 15:13 modules.symbols.bin
lrwxrwxrwx  1 root root      39 ноя 28 10:47 source -> /usr/src/linux-headers-4.19.0-13-common
vtVitus ★★★★★ ()