LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Please help compile ipt_route with path-o-matic (https://www.linuxquestions.org/questions/linux-server-73/please-help-compile-ipt_route-with-path-o-matic-832013/)

chobong 09-14-2010 12:49 AM

Please help compile ipt_route with path-o-matic
 
Dear All,

I have to load ipt_route into my iptables on Centos 5.3 .
I found a document about this
Code:

http://www.netfilter.org/documentation/HOWTO//netfilter-extensions-HOWTO-2.html#ss2.2
But I see that I cannot download and install like the document.
Code:

# cvs -d :pserver:cvs@pserver.netfilter.org:/cvspublic login
(When it asks you for a password type `cvs').
# cvs -d :pserver:cvs@pserver.netfilter.org:/cvspublic co netfilter/userspace netfilter/patch-o-matic

I don't know where's the correct link . Could you please share to me a detail for loading ipt_route?
Thanks so much!

knudfl 09-14-2010 01:25 AM

'patch-o-matic-ng' : Patch-O-Matic New Generation.

Google .. Patch-O-Matic ..

http://www.netfilter.org/projects/pa...-external.html

http://www.intra2net.com/en/developer/ipt_ACCOUNT/

The files
http://ftp.netfilter.org/pub/patch-o-matic-ng/
http://ftp.netfilter.org/pub/patch-o-matic-ng/snapshot/
patch-o-matic-ng-20100218.tar.bz2, 18-Feb-2010 23:55, 18K
etc. etc.

chobong 09-14-2010 02:41 AM

Thanks, knudfl!

I run ./runme successful. But I don't know how to recompile kernel and load ipt_route? :(
Please help me...

chobong 09-14-2010 04:02 AM

My server is :
Code:


uname -r
2.6.18-128.el5

I followed steps:
- yum install kernel-devel
- yum install iptables-devel
- download iptables-1.4.0.tar.bz2 and extract this file to /root/iptables-1.4.0
- download patch-o-matic-ng to /root/patch-o-matic-ng
- cd /root/patch-o-matic-ng
- ./runme --download
Code:

...
Successfully downloaded external patch rpc
Hey! KERNEL_DIR is not set.
Where is your kernel source directory? [/usr/src/linux] /usr/src/kernels/2.6.18-194.11.3.el5-i686
Hey! IPTABLES_DIR is not set.
Where is your iptables source code directory? [/usr/src/iptables] /root/iptables-1.4.0

- ./runme route
Code:

...
Excellent! Source trees are ready for compilation.

- cd /usr/src/kernels/2.6.18-194.11.3.el5-i686
- make oldconfig
- make prepare
- make modules_prepare
- cd /usr/src/kernels/2.6.18-194.11.3.el5-i686/net/ipv4/netfilter
Code:

ip_conntrack_mms.c      ip_conntrack_rsh.c  ip_nat_quake3.c  ip_set_iphash.c      ip_set_iptreemap.c  ipt_connlimit.c    ipt_IPV4OPTSSTRIP.c  ipt_set.c    Kconfig
ip_conntrack_quake3.c  ip_conntrack_rtsp.c  ip_nat_rtsp.c    ip_set_ipmap.c      ip_set_macipmap.c  ipt_IPMARK.c      ipt_pknock.c        ipt_SET.c    Makefile
ip_conntrack_rpc_tcp.c  ip_conntrack_talk.c  ip_nat_talk.c    ip_set_ipporthash.c  ip_set_nethash.c    ipt_ipp2p.c        ipt_ROUTE.c          ipt_TARPIT.c
ip_conntrack_rpc_udp.c  ip_nat_mms.c        ip_set.c        ip_set_iptree.c      ip_set_portmap.c    ipt_ipv4options.c  ipt_rpc.c            ipt_time.c

- make -C /usr/src/kernels/2.6.18-194.11.3.el5-i686 M=$PWD modules
Code:

make: Entering directory `/usr/src/kernels/2.6.18-194.11.3.el5-i686'
make[1]: *** No rule to make target `/usr/src/kernels/2.6.18-194.11.3.el5-i686/net/ipv4/netfilter/ip_conntrack_standalone.o', needed by `/usr/src/kernels/2.6.18-194.11.3.el5-i686/net/ipv4/netfilter/ip_conntrack.o'.  Stop.
make: *** [_module_/usr/src/kernels/2.6.18-194.11.3.el5-i686/net/ipv4/netfilter] Error 2
make: Leaving directory `/usr/src/kernels/2.6.18-194.11.3.el5-i686'

I don't know how to fix this? There is not ip_conntrack.o in /usr/src/kernels/2.6.18-194.11.3.el5-i686/net/ipv4/netfilter... :((

knudfl 09-14-2010 08:45 AM

Well, 'kernel-devel' is a limited package, almost no files.
Is meant only for building drivers, that come with their own
headers, etc.

The kernel source is kernel-2.6.18-194.el5.src.rpm, 79M
http://mirror.centos.org/centos/5.5/...94.el5.src.rpm

You have tons of work ahead of you, before you can use it :
Comes with at least 100 patches.
But may be you in some way can edit the file kernel.spec
and make things fit together ?
..

chobong 09-14-2010 10:59 PM

Thank you so much for your reply!

I downloaded *.src.rpm and compiled again. But when I run
make -C /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.i686 M=$PWD modules

Code:

$ make -C /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.i686 M=$PWD modules
make: Entering directory `/usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.i686'

  WARNING: Symbol version dump /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.i686/Module.symvers
          is missing; modules will have no dependencies and modversions.

  CC [M]  /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.i686/net/ipv4/netfilter/ip_conntrack_standalone.o
In file included from include/linux/netfilter_ipv4/ip_conntrack.h:31,
                from /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.i686/net/ipv4/netfilter/ip_conntrack_standalone.c:34:
include/linux/netfilter_ipv4/ip_conntrack_talk.h:7:43: error: linux/netfilter_ipv4/lockhelp.h: No such file or directory
In file included from include/linux/netfilter_ipv4/ip_conntrack.h:31,
                from /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.i686/net/ipv4/netfilter/ip_conntrack_standalone.c:34:
include/linux/netfilter_ipv4/ip_conntrack_talk.h:10: warning: data definition has no type or storage class
include/linux/netfilter_ipv4/ip_conntrack_talk.h:10: warning: type defaults to ‘int’ in declaration of ‘DECLARE_LOCK_EXTERN’
include/linux/netfilter_ipv4/ip_conntrack_talk.h:10: warning: parameter names (without types) in function declaration
make[1]: *** [/usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.i686/net/ipv4/netfilter/ip_conntrack_standalone.o] Error 1
make: *** [_module_/usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.i686/net/ipv4/netfilter] Error 2
make: Leaving directory `/usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.i686'
[admin@localhost netfilter]$ ls /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.i686/M
MAINTAINERS  Makefile

... :(

chobong 09-15-2010 06:10 AM

I tried with another patch-o-matic, it's ok but have no ipt_route in that patch.
Seems ipt_route is disabled for latest patchs version? But when I use an old patch, it shows error like previous reply...

How to I can add ipt_route into my iptables? >.<


All times are GMT -5. The time now is 05:32 AM.