From: Subject: problem with ICMP forwarding Date: Tue, 25 Feb 2003 11:59:14 +0200 Sender: netfilter-admin@lists.netfilter.org Message-ID: <005001c2dcb4$8d678170$01000001@mfa.ee> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_004D_01C2DCC5.50E295D0" Return-path: Errors-To: netfilter-admin@lists.netfilter.org List-Help: List-Post: List-Subscribe: , List-Id: List-Unsubscribe: , List-Archive: To: netfilter@lists.netfilter.org This is a multi-part message in MIME format. ------=_NextPart_000_004D_01C2DCC5.50E295D0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable hi, I have redhat 8.0 with iptabes iptables-1.2.6a-2 Problem is with icmp forwarding between internal host behind linux = router and=20 Internet. internal host ------ eth1 --Linux router --eth0-- Internet =20 Router's routing table: Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use = Iface 195.12.1.4 10.3.1.2 255.255.255.255 UGH 0 0 0 = eth1 195.12.1.0 0.0.0.0 255.255.255.240 U 0 0 = 0 eth0 10.3.1.0 0.0.0.0 255.255.255.0 U 0 0 = 0 eth1 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 = 0 lo 0.0.0.0 195.12.1.1 0.0.0.0 UG 0 0 = 0 eth0 $IPTABLES -t nat -A POSTROUTING -o $EXTIF -s $SRV_INT_IP -j SNAT --to = $SRV_EXT_IP extif=3D"eth0" intif=3D"eth1" srv_int_ip=3D"10.3.1.2" srv_ext_ip=3D"195.12.1.4" I changed all default polices to ACCEPT=20 $IPTABLES -P INPUT ACCEPT $IPTABLES -P OUTPUT ACCEPT $IPTABLES -P FORWARD ACCEPT #Enable forwarding in kernel echo 1 > /proc/sys/net/ipv4/ip_forward Everything works just fine till I try to ping 195.12.1.4 from public = network. tcpdump listening at internal interface eth1: 12:48:45.990720 195.80.106.33 > 195.12.1.4: icmp: echo request 12:48:47.157450 195.80.106.33 > 195.12.1.4: icmp: echo request 12:48:48.159049 195.80.106.33 > 195.12.1.4: icmp: echo request 12:48:49.160159 195.80.106.33 > 195.12.1.4: icmp: echo request when I remove static route=20 195.12.1.4 10.3.1.2 255.255.255.255 UGH 0 0 0 = eth1 from the routing table I get destination host unreachable message from = routers external interface while=20 pinging 195.12.1.4 from Internet. any tcp, udp connection from 10.3.1.2 are ok and translated to = 195.12.1.4. I just can't figure out why icmp request won't reach 10.3.1.2. My guess = is that something different must be done with=20 routing table but I'm not sure what. Any help greatly appreciated. Thanks, vmtesting ------=_NextPart_000_004D_01C2DCC5.50E295D0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
hi,
 
I have redhat 8.0 with iptabes=20 iptables-1.2.6a-2
Problem is  with icmp forwarding = between=20 internal host behind linux router and
Internet.
 
internal host ------ eth1 --Linux=20 router --eth0-- Internet
 
Router's routing = table:

Kernel IP routing table
Destination    =20 Gateway        =20 Genmask         Flags Metric=20 Ref    Use Iface
195.12.1.4  =20  10.3.1.2       255.255.255.255=20 UGH   0     =20 0        0 = eth1
195.12.1.0  =20   0.0.0.0        =20 255.255.255.240  U      =20 0      = 0        0=20 eth0
10.3.1.0      =20 0.0.0.0        =20 255.255.255.0     U      =20 0      = 0        0=20 eth1
127.0.0.0      =20 0.0.0.0        =20 255.0.0.0          &nbs= p;=20 U       0     =20 0        0=20 lo
0.0.0.0         = 195.12.1.1 =20 0.0.0.0           =        =20 UG    0     =20 0        0 eth0
$IPTABLES -t nat -A POSTROUTING -o $EXTIF -s $SRV_INT_IP -j SNAT = --to=20 $SRV_EXT_IP
 
extif=3D"eth0"
intif=3D"eth1"
srv_int_ip=3D"10.3.1.2"
srv_ext_ip=3D"195.12.1.4"
 
I changed all default polices to ACCEPT
$IPTABLES -P INPUT ACCEPT
$IPTABLES -P OUTPUT = ACCEPT
$IPTABLES -P=20 FORWARD ACCEPT
 
#Enable forwarding in kernel
echo 1 >=20 /proc/sys/net/ipv4/ip_forward
Everything works just fine till I try to ping 195.12.1.4 from = public=20 network.
 
tcpdump listening at internal interface eth1:
12:48:45.990720 195.80.106.33 > 195.12.1.4: icmp: echo=20 request
12:48:47.157450 195.80.106.33 > 195.12.1.4: icmp: echo=20 request
12:48:48.159049 195.80.106.33 > 195.12.1.4: icmp: echo=20 request
12:48:49.160159 195.80.106.33 > 195.12.1.4: icmp: = echo=20 request
when I remove static route
195.12.1.4   =  10.3.1.2      =20 255.255.255.255 UGH   0     =20 0        0 eth1
from the routing table I get destination host unreachable message = from=20 routers external interface while
pinging 195.12.1.4 from Internet.
 
any tcp, udp connection from 10.3.1.2 are ok and translated to=20 195.12.1.4.
 
I just can't figure out why icmp request won't reach 10.3.1.2. My = guess is=20 that something different must be done with
routing table but I'm not sure what.
 
 
Any help greatly appreciated.
 
Thanks,
vmtesting
 
------=_NextPart_000_004D_01C2DCC5.50E295D0--