On 08/28/2012 11:12 AM, Mark van Dijk wrote:
Tom hi,
Back in 2011 you added the TTL target in tcrules per my request:
http://www.mail-archive.com/[email protected]/msg12420.html
Today I tried adding the rule to tcrules in shorewall 4.5.5.3 on the
following (typical) setup:
Internet -> eth0(in) -> Shorewall -> eth1(out) -> internal hosts
/etc/shorewall/tcrules:
TTL(+1) eth0 eth1 all
With said Shorewall version, I found that TTL is only allowed to be
added to the FORWARD chain in the mangle table. However, in order to
hide 'Shorewall' from e.g. traceroute in the above setup,
it has to be
added to the PREROUTING chain of the mangle table. Currently this is not
allowed. Could you please make it possible? In other words:
TTL(+1):P eth0 eth1 all
Patch attached.
-Tom
--
Tom Eastep \ When I die, I want to go like my Grandfather who
Shoreline, \ died peacefully in his sleep. Not screaming like
Washington, USA \ all of the passengers in his car
http://shorewall.net \________________________________________________
diff --git a/Shorewall/Perl/Shorewall/Tc.pm b/Shorewall/Perl/Shorewall/Tc.pm
index 095be3f..8ac2140 100644
--- a/Shorewall/Perl/Shorewall/Tc.pm
+++ b/Shorewall/Perl/Shorewall/Tc.pm
@@ -384,10 +384,16 @@ sub process_tc_rule( ) {
TTL => sub() {
fatal_error "TTL is not supported in IPv6 - use HL instead" if $family == F_IPV6;
fatal_error "Invalid TTL specification( $cmd/$rest )" if $rest;
- fatal_error "Chain designator $designator not allowed with TTL" if $designator && ! ( $designator eq 'F' );
-
$chain = 'tcfor';
+ if ( $designator ) {
+ if ( $designator eq 'P' ) {
+ $chain = 'tcpre';
+ } else {
+ fatal_error "Chain designator $designator not allowed with TTL" if $designator ne 'F';
+ }
+ }
+
$cmd =~ /^TTL\(([-+]?\d+)\)$/;
my $param = $1;
@@ -405,10 +411,17 @@ sub process_tc_rule( ) {
HL => sub() {
fatal_error "HL is not supported in IPv4 - use TTL instead" if $family == F_IPV4;
fatal_error "Invalid HL specification( $cmd/$rest )" if $rest;
- fatal_error "Chain designator $designator not allowed with HL" if $designator && ! ( $designator eq 'F' );
-
$chain = 'tcfor';
+
+ if ( $designator ) {
+ if ( $designator eq 'P' ) {
+ $chain = 'tcpre';
+ } else {
+ fatal_error "Chain designator $designator not allowed with HL" if $designator ne 'F';
+ }
+ }
+
$cmd =~ /^HL\(([-+]?\d+)\)$/;
my $param = $1;
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Shorewall-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-users