Debian xtables-addons-dkms Compilation Failed

rmoglia

Member
Jul 28, 2009
83
0
6
i tryed use dkms xtables from debian. geoip iptables is important to control bad trafic to any server without using larger ip list.


Code:
dpkg-reconfigure xtables-addons-dkms -- no sucess.

Code:
Done.
Loading new xtables-addons-1.42 DKMS files...
Building for 2.6.32-32-pve and 3.10.0-5-pve
Building initial module for 2.6.32-32-pve
Error!  Build of xt_ACCOUNT.ko failed for: 2.6.32-32-pve (x86_64)
Consult the make.log in the build directory
/var/lib/dkms/xtables-addons/1.42/build/ for more information.

Code:
expr: syntax error
make: Entering directory `/usr/src/linux-headers-2.6.32-32-pve'
  CC [M]  /usr/src/xtables-addons-1.42/compat_xtables.o
  CC [M]  /usr/src/xtables-addons-1.42/xt_CHAOS.o
  CC [M]  /usr/src/xtables-addons-1.42/xt_DELUDE.o
  CC [M]  /usr/src/xtables-addons-1.42/xt_DHCPMAC.o
  CC [M]  /usr/src/xtables-addons-1.42/xt_DNETMAP.o
/usr/src/xtables-addons-1.42/xt_DNETMAP.c: In function ‘dnetmap_tg’:
/usr/src/xtables-addons-1.42/xt_DNETMAP.c:318:14: warning: unused variable ‘net’ [-Wunused-variable]
  CC [M]  /usr/src/xtables-addons-1.42/xt_ECHO.o
/usr/src/xtables-addons-1.42/xt_ECHO.c: In function ‘echo_tg6’:
/usr/src/xtables-addons-1.42/xt_ECHO.c:36:16: error: storage size of ‘fl’ isn’t known
/usr/src/xtables-addons-1.42/xt_ECHO.c:99:37:  error: implicit declaration of function ‘flowi6_to_flowi’  [-Werror=implicit-function-declaration]
/usr/src/xtables-addons-1.42/xt_ECHO.c:119:2:  error: implicit declaration of function ‘ip6_local_out’  [-Werror=implicit-function-declaration]
/usr/src/xtables-addons-1.42/xt_ECHO.c:36:16: warning: unused variable ‘fl’ [-Wunused-variable]
cc1: some warnings being treated as errors
make[1]: *** [/usr/src/xtables-addons-1.42/xt_ECHO.o] Error 1
make: *** [_module_/usr/src/xtables-addons-1.42] Error 2
make: Leaving directory `/usr/src/linux-headers-2.6.32-32-pve'


Any idea how solve it? Thanks Alot!
 
Solution:

#Install Packages
Code:
apt-get update  
apt-get install iptables iptables-dev module-assistant xtables-addons-common libtext-csv-xs-perl unzip

#After That, Build Geoip Database

Code:
cd /usr/lib/xtables-addons/  
./xt_geoip_dl
./xt_geoip_build GeoIPCountryWhois.csv
mkdir -p /usr/share/xt_geoip/  
cp -r {BE,LE} /usr/share/xt_geoip/

# Also, Do Not Forget Install the pve kernel headers
Code:
apt-get install pve-headers-`uname -r`

# Next, edit compile options for xtables-addons

Code:
nano /usr/src/modules/xtables-addons/mconfig

# Now remove the end-of-line "m" from all lines except for
# the following: build_geoip, build_pknock and build_psd.
# Save the file with Ctrl-O and exit nano with Ctrl-X.

Code:
chattr +i /usr/src/modules/xtables-addons/mconfig

# Finally, Run the "module-assistant"

Code:
module-assistant --verbose --text-mode auto-install xtables-addons
 
Hello ,

I tryed and it's not working ...
root@dd:~/xtables-addons-1.47# modprobe xt_geoip
ERROR: could not insert 'xt_geoip': Exec format error