* loopback and pointopoint interfaces
@ 2003-01-30 11:00 Jarek Sobieszek
[not found] ` <20030130143348.GC8060@localhost.localdomain>
0 siblings, 1 reply; 3+ messages in thread
From: Jarek Sobieszek @ 2003-01-30 11:00 UTC (permalink / raw)
To: netfilter
Hello,
I have some problems testing local interfaces over loopback.
Consider the following setup:
if0: 10.1.1.1 pointopoint 10.1.1.12
if1: 10.1.1.2 pointopoint 10.1.1.11
cable connects if0 with if1
iptables -A POSTROUTING -t nat -d 10.1.1.11 -j SNAT --to 10.1.1.12
iptables -A POSTROUTING -t nat -d 10.1.1.12 -j SNAT --to 10.1.1.11
iptables -A PREROUTING -t nat -d 10.1.1.11 -j DNAT --to 10.1.1.1
iptables -A PREROUTING -t nat -d 10.1.1.12 -j DNAT --to 10.1.1.2
ping 10.1.1.11 and ping 10.1.1.12 work as expected
Here's what I believe is going on:
ping 10.1.1.11
src dst
10.1.1.2 10.1.1.11
POSTROUTING(if1)
10.1.1.12 10.1.1.11
OUT: if1
IN: if0
10.1.1.12 10.1.1.11
PREROUTING(if0)
10.1.1.12 10.1.1.1
ICMP
10.1.1.1 10.1.1.12
POSTROUTING(if0)
10.1.1.11 10.1.1.12
OUT: if0
IN: if1
10.1.1.11 10.1.1.12
PREROUTING(if1)
10.1.1.11 10.1.1.2
ping response from 10.1.1.2
Now the setup which I cannot make to work:
if0: 10.1.1.1 pointopoint 10.1.1.12
if1: 10.1.1.3 pointopoint 10.1.1.14
if2: 10.1.1.4 pointopoint 10.1.1.13
if3: 10.1.1.2 pointopoint 10.1.1.11
cables connect if0 to if1 and if2 to if3
iptables -A POSTROUTING -t nat -d 10.1.1.11 -j SNAT --to 10.1.1.3
iptables -A POSTROUTING -t nat -d 10.1.1.12 -j SNAT --to 10.1.1.4
iptables -A POSTROUTING -t nat -d 10.1.1.13 -j SNAT --to 10.1.1.11
iptables -A POSTROUTING -t nat -d 10.1.1.14 -j SNAT --to 10.1.1.12
iptables -A PREROUTING -t nat -d 10.1.1.11 -j DNAT --to 10.1.1.14
iptables -A PREROUTING -t nat -d 10.1.1.12 -j DNAT --to 10.1.1.13
iptables -A PREROUTING -t nat -d 10.1.1.13 -j DNAT --to 10.1.1.2
iptables -A PREROUTING -t nat -d 10.1.1.14 -j DNAT --to 10.1.1.1
ping 10.1.1.1 and ping 10.1.1.2 don't work
Here's what I believe should be going on (but apparently it isn't):
ping 10.1.1.11
src dst
10.1.1.2 10.1.1.11
POSTROUTING(if3)
10.1.1.3 10.1.1.11
OUT: if3
IN: if2
10.1.1.3 10.1.1.11
PREROUTING(if2)
10.1.1.3 10.1.1.14 (FWD)
POSTROUTING(if1)
10.1.1.12 10.1.1.14
OUT: if1
IN: if0
10.1.1.12 10.1.1.14
PREROUTING(if0)
10.1.1.12 10.1.1.1
ICMP
10.1.1.1 10.1.1.12
POSTROUTING(if0)
10.1.1.4 10.1.1.12
OUT:if0
IN:if1
10.1.1.4 10.1.1.12
PREROUTING(if1)
10.1.1.4 10.1.1.13 (FWD)
POSTROUTING(if2)
10.1.1.11 10.1.1.13
OUT:if2
IN:if3
10.1.1.11 10.1.1.13
PREROUTING(if3)
10.1.1.11 10.1.1.2
ping response from 10.1.1.2
Any ideas why it doesn't work (I enabled ip_forward and disabled
rp_filter)?
And is it posible to blindly forward packets from if1/if2 to if2/if1
(since the devices are not ehernet I think ethernet bridging does not
qualify)?
Thanks,
Jarek Sobieszek
^ permalink raw reply [flat|nested] 3+ messages in thread[parent not found: <20030130143348.GC8060@localhost.localdomain>]
* loopback and pointopoint interfaces [not found] ` <20030130143348.GC8060@localhost.localdomain> @ 2003-01-30 14:35 ` Jarek Sobieszek 2003-01-30 16:45 ` Jarek Sobieszek 0 siblings, 1 reply; 3+ messages in thread From: Jarek Sobieszek @ 2003-01-30 14:35 UTC (permalink / raw) To: netfilter Hello, I have some problems testing local interfaces over loopback. Consider the following setup: if0: 10.1.1.1 pointopoint 10.1.1.12 if1: 10.1.1.2 pointopoint 10.1.1.11 cable connects if0 with if1 iptables -A POSTROUTING -t nat -d 10.1.1.11 -j SNAT --to 10.1.1.12 iptables -A POSTROUTING -t nat -d 10.1.1.12 -j SNAT --to 10.1.1.11 iptables -A PREROUTING -t nat -d 10.1.1.11 -j DNAT --to 10.1.1.1 iptables -A PREROUTING -t nat -d 10.1.1.12 -j DNAT --to 10.1.1.2 ping 10.1.1.11 and ping 10.1.1.12 work as expected Here's what I believe is going on: ping 10.1.1.11 src dst 10.1.1.2 10.1.1.11 POSTROUTING(if1) 10.1.1.12 10.1.1.11 OUT: if1 IN: if0 10.1.1.12 10.1.1.11 PREROUTING(if0) 10.1.1.12 10.1.1.1 ICMP 10.1.1.1 10.1.1.12 POSTROUTING(if0) 10.1.1.11 10.1.1.12 OUT: if0 IN: if1 10.1.1.11 10.1.1.12 PREROUTING(if1) 10.1.1.11 10.1.1.2 ping response from 10.1.1.2 Now the setup which I cannot make to work: if0: 10.1.1.1 pointopoint 10.1.1.12 if1: 10.1.1.3 pointopoint 10.1.1.14 if2: 10.1.1.4 pointopoint 10.1.1.13 if3: 10.1.1.2 pointopoint 10.1.1.11 cables connect if0 to if1 and if2 to if3 iptables -A POSTROUTING -t nat -d 10.1.1.11 -j SNAT --to 10.1.1.3 iptables -A POSTROUTING -t nat -d 10.1.1.12 -j SNAT --to 10.1.1.4 iptables -A POSTROUTING -t nat -d 10.1.1.13 -j SNAT --to 10.1.1.11 iptables -A POSTROUTING -t nat -d 10.1.1.14 -j SNAT --to 10.1.1.12 iptables -A PREROUTING -t nat -d 10.1.1.11 -j DNAT --to 10.1.1.14 iptables -A PREROUTING -t nat -d 10.1.1.12 -j DNAT --to 10.1.1.13 iptables -A PREROUTING -t nat -d 10.1.1.13 -j DNAT --to 10.1.1.2 iptables -A PREROUTING -t nat -d 10.1.1.14 -j DNAT --to 10.1.1.1 ping 10.1.1.1 and ping 10.1.1.2 don't work Here's what I believe should be going on (but apparently it isn't): ping 10.1.1.11 src dst 10.1.1.2 10.1.1.11 POSTROUTING(if3) 10.1.1.3 10.1.1.11 OUT: if3 IN: if2 10.1.1.3 10.1.1.11 PREROUTING(if2) 10.1.1.3 10.1.1.14 (FWD) POSTROUTING(if1) 10.1.1.12 10.1.1.14 OUT: if1 IN: if0 10.1.1.12 10.1.1.14 PREROUTING(if0) 10.1.1.12 10.1.1.1 ICMP 10.1.1.1 10.1.1.12 POSTROUTING(if0) 10.1.1.4 10.1.1.12 OUT:if0 IN:if1 10.1.1.4 10.1.1.12 PREROUTING(if1) 10.1.1.4 10.1.1.13 (FWD) POSTROUTING(if2) 10.1.1.11 10.1.1.13 OUT:if2 IN:if3 10.1.1.11 10.1.1.13 PREROUTING(if3) 10.1.1.11 10.1.1.2 ping response from 10.1.1.2 Any ideas why it doesn't work (I enabled ip_forward and disabled rp_filter)? And is it posible to blindly forward packets from if1/if2 to if2/if1 (since the devices are not ehernet I think ethernet bridging does not qualify)? Thanks, Jarek Sobieszek ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: loopback and pointopoint interfaces 2003-01-30 14:35 ` Jarek Sobieszek @ 2003-01-30 16:45 ` Jarek Sobieszek 0 siblings, 0 replies; 3+ messages in thread From: Jarek Sobieszek @ 2003-01-30 16:45 UTC (permalink / raw) To: netfilter > iptables -A POSTROUTING -t nat -d 10.1.1.11 -j SNAT --to 10.1.1.3 > iptables -A POSTROUTING -t nat -d 10.1.1.12 -j SNAT --to 10.1.1.4 It should have been: iptables -A POSTROUTING -t nat -d 10.1.1.11 -j SNAT --to 10.1.1.13 iptables -A POSTROUTING -t nat -d 10.1.1.12 -j SNAT --to 10.1.1.14 Previously the packets were dropped by fib_validate_source. Jarek Sobieszek ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-01-30 16:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-30 11:00 loopback and pointopoint interfaces Jarek Sobieszek
[not found] ` <20030130143348.GC8060@localhost.localdomain>
2003-01-30 14:35 ` Jarek Sobieszek
2003-01-30 16:45 ` Jarek Sobieszek
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.