Καλησπέρα,

Στο HOME LAN έχω ένα raspberry pi 2 για server (hostname: galois). Ο (φίλος μας) o Galois σηκώνει OpenVPN και δρομολογεί όλες τις συνδέσεις από tun0. Θα ήθελα να δημιουργήσω ένα hash:IP table στον router (carambola / openwrt). Όποιο IP είναι στο table θα ήθελα να γίνεται το connection DNAT μέσω του Galois. Αρχικά, προσπάθησα να στήσω το redirect με 1 IP. Καθότι IPtables primer, μετά από κάποια μελέτη κατέληξα σε αυτούς τους κανόνες:

Κώδικας:
iptables -t nat -A PREROUTING -d 1x1.0.1x4.xx -p all  -j DNAT --to-destination galois.local
iptables -t nat -A POSTROUTING --dst 1x1.0.1x4.xx —p all -j SNAT --to-source galois.local
iptables -t nat -A OUTPUT --dst 1x1.0.1x4.xx -p all -j DNAT --to-destination galois.local
Ωστόσο, με tcpdump στον Galois, δεν βλέπω κανένα πακέτο να φτάνει ποτέ εκεί. Ο router προφανώς δεν κάνει DNAT σωστά. Τα logs από iptables δείχνουν πως κάποια πακέτα μπαίνουν στο chain αλλά μάλλον δεν πάνε πουθενά:

Κώδικας:
Chain PREROUTING (policy ACCEPT 37768 packets, 3195K bytes)
pkts bytes target     prot opt in     out     source               destination
47434 4047K prerouting_rule  all  --  any    any     anywhere             anywhere
41538 3631K zone_lan_prerouting  all  --  br-lan any     anywhere             anywhere
   10   648 DNAT       all  --  any    any     anywhere             1χ1.0.1χ4.χχ        to:192.168.3.4
 5748  405K zone_wan_prerouting  all  --  pppoe-wan any     anywhere             anywhere

Chain INPUT (policy ACCEPT 16301 packets, 1107K bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 10332 packets, 701K bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DNAT       all  --  any    any     anywhere             1χ1.0.1χ4.χχ        to:192.168.3.4

Chain POSTROUTING (policy ACCEPT 51 packets, 12573 bytes)
 pkts bytes target     prot opt in     out     source               destination
29020 2028K postrouting_rule  all  --  any    any     anywhere             anywhere
   61 15006 zone_lan_nat  all  --  any    br-lan  anywhere             anywhere
    0     0 SNAT       all  --  any    any     anywhere             1χ1.0.1χ4.χχ        to:192.168.3.4
24899 1749K zone_wan_nat  all  --  any    pppoe-wan  anywhere             anywhere

Chain nat_reflection_in (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain nat_reflection_out (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain postrouting_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination
29020 2028K nat_reflection_out  all  --  any    any     anywhere             anywhere

Chain prerouting_lan (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain prerouting_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination
47432 4047K nat_reflection_in  all  --  any    any     anywhere             anywhere

Chain prerouting_wan (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain zone_lan_nat (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain zone_lan_prerouting (1 references)
 pkts bytes target     prot opt in     out     source               destination
41538 3631K prerouting_lan  all  --  any    any     anywhere             anywhere

Chain zone_wan_nat (1 references)
 pkts bytes target     prot opt in     out     source               destination
28948 2012K MASQUERADE  all  --  any    any     anywhere             anywhere

Chain zone_wan_prerouting (1 references)
 pkts bytes target     prot opt in     out     source               destination
 5893  416K prerouting_wan  all  --  any    any     anywhere             anywhere
Όπου 192.168.3.4 είναι ο Galois φυσικά. Ο galois έχει forwarding enabled κι όταν τον χρησιμοποιώ ως gateway λειτουργεί κανονικά προωθώντας τις συνδέσεις. Ωστόσο, τα πακέτα εκεί δεν φτάνουν ποτέ.

Any ideas on how to proceed? :-)

Ευχαριστώ!