Re: [xtables-addons] [SOLVED] "unknown option `--gw'" for target TEE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Replying to self, funny how a night's sleep help find new approaches.

On Wed, Nov 25, 2009 at 09:34:34AM +0100, Olivier Mehani wrote:
> # ip6tables -t mangle -A PREROUTING -i eth0 -j TEE --gw PFX1:46ff:fee0:dfcc
> ip6tables v1.4.5: unknown option `--gw'
> Try `ip6tables -h' or 'ip6tables --help' for more information.
> 
> As far as my understanding of the doc goes, my command is valid, but it
> doesn't work.

In contradiction with the documentation, the proper parameter is
actually --gateway, thus
# ip6tables -t mangle -A PREROUTING -i eth0 -j TEE --gateway PFX1:EUI64
works like a charm.

Maybe the documentation should be udpated as per the attached patch?
It removes all occurences of --gw in the dor and error messages, and
adds a quick example (quite similar to my scenario).

Finally, beware of router advertisements.

-- 
Olivier Mehani <shtrom@xxxxxxxx>
PGP fingerprint: 4435 CF6A 7C8D DD9B E2DE  F5F9 F012 A6E2 98C6 6655
Index: xtables-addons-1.20/extensions/libxt_TEE.c
===================================================================
--- xtables-addons-1.20.orig/extensions/libxt_TEE.c
+++ xtables-addons-1.20/extensions/libxt_TEE.c
@@ -51,7 +51,7 @@ static int tee_tg_parse(int c, char **ar
 	case 'g':
 		if (*flags & FLAG_GATEWAY)
 			xtables_error(PARAMETER_PROBLEM,
-			           "Cannot specify --gw more than once");
+			           "Cannot specify --gateway more than once");
 
 		ia = xtables_numeric_to_ipaddr(optarg);
 		if (ia == NULL)
@@ -76,7 +76,7 @@ static int tee_tg6_parse(int c, char **a
 	case 'g':
 		if (*flags & FLAG_GATEWAY)
 			xtables_error(PARAMETER_PROBLEM,
-			           "Cannot specify --gw more than once");
+			           "Cannot specify --gateway more than once");
 
 		ia = xtables_numeric_to_ip6addr(optarg);
 		if (ia == NULL)
Index: xtables-addons-1.20/extensions/libxt_TEE.man
===================================================================
--- xtables-addons-1.20.orig/extensions/libxt_TEE.man
+++ xtables-addons-1.20/extensions/libxt_TEE.man
@@ -3,6 +3,10 @@ machine on the \fBlocal\fP network segme
 must be the target, or you will have to configure the nexthop to forward it
 further if so desired.
 .TP
-\fB\-\-gw\fP \fIipaddr\fP
+\fB\-\-gateway\fP \fIipaddr\fP
 Send the cloned packet to the host reachable at the given IP address.
 Use of 0.0.0.0 (for IPv4 packets) or :: (IPv6) is invalid.
+.TP
+To forward all incoming traffic on eth0 to an IP-level logging box:
+.IP
+\-t mangle -A PREROUTING -i eth0 -j TEE --gateway 2001:db8::1
Index: xtables-addons-1.20/extensions/xt_TEE.c
===================================================================
--- xtables-addons-1.20.orig/extensions/xt_TEE.c
+++ xtables-addons-1.20/extensions/xt_TEE.c
@@ -175,7 +175,7 @@ tee_tg4(struct sk_buff **pskb, const str
 	/*
 	 * Copy the skb, and route the copy. Will later return %XT_CONTINUE for
 	 * the original skb, which should continue on its way as if nothing has
-	 * happened. The copy should be independently delivered to the TEE --gw.
+	 * happened. The copy should be independently delivered to the TEE --gateway.
 	 */
 	skb = skb_copy(skb, GFP_ATOMIC);
 	if (skb == NULL) {
Index: xtables-addons-1.20/xtables-addons.8
===================================================================
--- xtables-addons-1.20.orig/xtables-addons.8
+++ xtables-addons-1.20/xtables-addons.8
@@ -48,9 +48,13 @@ machine on the \fBlocal\fP network segme
 must be the target, or you will have to configure the nexthop to forward it
 further if so desired.
 .TP
-\fB\-\-gw\fP \fIipaddr\fP
+\fB\-\-gateway\fP \fIipaddr\fP
 Send the cloned packet to the host reachable at the given IP address.
 Use of 0.0.0.0 (for IPv4 packets) or :: (IPv6) is invalid.
+.TP
+To forward all incoming traffic on eth0 to an IP-level logging box:
+.IP
+\-t mangle -A PREROUTING -i eth0 -j TEE --gateway 2001:db8::1
 .SS RAWSNAT
 The \fBRAWSNAT\fR and \fBRAWDNAT\fP targets provide stateless network address
 translation.

Attachment: pgpthpmLMts7Y.pgp
Description: PGP signature


[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux