Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
iptables -j ROUTE - patch-o-matic - ggf. Alternative?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
slick
Bodhisattva
Bodhisattva


Joined: 20 Apr 2003
Posts: 3495

PostPosted: Sun Oct 19, 2008 5:17 pm    Post subject: iptables -j ROUTE - patch-o-matic - ggf. Alternative? Reply with quote

Ich würde gern Pakete mit iptables routen. Die Lösung scheint ROUTE aus dem patch-o-matic zu sein. Ich habe die Patches gemäß der Anleitung hier bzw. dieser hier eingefügt, allerdings mag es mit 2.6.25-gentoo-r8 Kernel nicht.

Code:

scripts/kconfig/conf -s arch/x86/Kconfig
  CHK     include/linux/version.h
  CHK     include/linux/utsrelease.h
  CALL    scripts/checksyscalls.sh
  CHK     include/linux/compile.h
  GZIP    kernel/config_data.gz
  IKCFG   kernel/config_data.h
  CC      kernel/configs.o
  LD      kernel/built-in.o
  CC      net/ipv4/netfilter/ipt_ROUTE.o
net/ipv4/netfilter/ipt_ROUTE.c: In function 'route':
net/ipv4/netfilter/ipt_ROUTE.c:105: warning: passing argument 1 of 'ip_route_output_key' from incompatible pointer type
net/ipv4/netfilter/ipt_ROUTE.c:105: warning: passing argument 2 of 'ip_route_output_key' from incompatible pointer type
net/ipv4/netfilter/ipt_ROUTE.c:105: error: too few arguments to function 'ip_route_output_key'
net/ipv4/netfilter/ipt_ROUTE.c: In function 'ipt_route_target':
net/ipv4/netfilter/ipt_ROUTE.c:363: error: 'NF_IP_PRE_ROUTING' undeclared (first use in this function)
net/ipv4/netfilter/ipt_ROUTE.c:363: error: (Each undeclared identifier is reported only once
net/ipv4/netfilter/ipt_ROUTE.c:363: error: for each function it appears in.)
net/ipv4/netfilter/ipt_ROUTE.c:364: error: 'NF_IP_LOCAL_IN' undeclared (first use in this function)
net/ipv4/netfilter/ipt_ROUTE.c:390: warning: passing argument 1 of 'ip_route_output_key' from incompatible pointer type
net/ipv4/netfilter/ipt_ROUTE.c:390: warning: passing argument 2 of 'ip_route_output_key' from incompatible pointer type
net/ipv4/netfilter/ipt_ROUTE.c:390: error: too few arguments to function 'ip_route_output_key'
net/ipv4/netfilter/ipt_ROUTE.c: In function 'ipt_route_checkentry':
net/ipv4/netfilter/ipt_ROUTE.c:495: error: 'NF_IP_PRE_ROUTING' undeclared (first use in this function)
net/ipv4/netfilter/ipt_ROUTE.c:496: error: 'NF_IP_LOCAL_IN' undeclared (first use in this function)
net/ipv4/netfilter/ipt_ROUTE.c:497: error: 'NF_IP_FORWARD' undeclared (first use in this function)
net/ipv4/netfilter/ipt_ROUTE.c:498: error: 'NF_IP_LOCAL_OUT' undeclared (first use in this function)
net/ipv4/netfilter/ipt_ROUTE.c:499: error: 'NF_IP_POST_ROUTING' undeclared (first use in this function)
make[3]: *** [net/ipv4/netfilter/ipt_ROUTE.o] Error 1
make[2]: *** [net/ipv4/netfilter] Error 2
make[1]: *** [net/ipv4] Error 2
make: *** [net] Error 2


Ich muss ja mal bemerken dieses manuelle Patchen gefällt mir auch nicht wirklich. Gibt es eine bessere Lösung um an den Route-Patch zu kommen (der dann auch funktioniert) oder gibt es gar eine andere Lösung um Pakete per iptables zu routen?
Back to top
View user's profile Send private message
slick
Bodhisattva
Bodhisattva


Joined: 20 Apr 2003
Posts: 3495

PostPosted: Sun Oct 19, 2008 7:11 pm    Post subject: Reply with quote

Als Alternative habe ich noch Policy Routing gefunden. Allerdings konnte ich das nötige IP_ROUTE_FWMARK im Kernel nicht finden. Ist die Howto in dem Punkt veraltet?
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6780

PostPosted: Mon Oct 20, 2008 8:16 am    Post subject: Reply with quote

Wenn Du nicht Dein Problem beschreibst, wird Dir auch niemand Alternativen nennen können. Da Du nur unspezifiert nach "routen" fragst, meinst Du wahrscheinlich in Wirklichkeit MASQUERADING, was ohne irgendwelche Patches funktioniert.
Back to top
View user's profile Send private message
slick
Bodhisattva
Bodhisattva


Joined: 20 Apr 2003
Posts: 3495

PostPosted: Mon Oct 20, 2008 3:21 pm    Post subject: Reply with quote

Achso ... ehm ... ja ...

Nein, nicht (nur) NAT. Ich habe mehrere Gateways ins Internet im LAN und möchte Pakete anhand bestimmter Kriterien über die verschiedenen Gateways routen. Z.B. Zielport 80 über Gateway 1, Quelle 192.168.2.0/24 über Gateway 2, Zielport 25 über Gateway 3. Die Pakete möchte ich idealerweise mit iptables selektieren, da diese mir alle nötigen Optionen dafür bieten.
Back to top
View user's profile Send private message
hurra
Apprentice
Apprentice


Joined: 11 Apr 2004
Posts: 224

PostPosted: Sat Oct 25, 2008 6:17 pm    Post subject: Reply with quote

Hi.

Du kannst mit den iptables die Pakete markieren und dann anhand dieser Markierungen über verschiedene Gateways routen lassen.

Du brauchst dafür iproute2.

Cu hurra
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum