Καλησπέρα,
Στο 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, μετά από κάποια μελέτη κατέληξα σε αυτούς τους κανόνες:
Ωστόσο, με tcpdump στον Galois, δεν βλέπω κανένα πακέτο να φτάνει ποτέ εκεί. Ο router προφανώς δεν κάνει DNAT σωστά. Τα logs από iptables δείχνουν πως κάποια πακέτα μπαίνουν στο chain αλλά μάλλον δεν πάνε πουθενά:Κώδικας: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
Όπου 192.168.3.4 είναι ο Galois φυσικά. Ο galois έχει forwarding enabled κι όταν τον χρησιμοποιώ ως gateway λειτουργεί κανονικά προωθώντας τις συνδέσεις. Ωστόσο, τα πακέτα εκεί δεν φτάνουν ποτέ.Κώδικας: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
Any ideas on how to proceed? :-)
Ευχαριστώ!
Εμφάνιση 1-1 από 1
Θέμα: OpenWRT DNAT (iptables)
-
28-06-15, 01:05 OpenWRT DNAT (iptables) #1
Παρόμοια Θέματα
-
Mikrotik Routerboards με Openwrt
Από Nikiforos στο φόρουμ MikroTik ADSL modems, routers & routerBOARDsΜηνύματα: 101Τελευταίο Μήνυμα: 10-01-24, 12:48 -
firewalld vs iptables
Από DVader στο φόρουμ Unix - LinuxΜηνύματα: 0Τελευταίο Μήνυμα: 24-06-15, 23:40 -
[TP-Link] WDR3600 (OpenWRT) ως ρουτερ και Pirelli AV4202N ως modem πρόβλημα με portforward
Από hambos22 στο φόρουμ ADSL & Broadband Hardware, routers και modems...Μηνύματα: 7Τελευταίο Μήνυμα: 01-02-15, 00:34 -
Απλό QOS σε TP-Link 3600 με OpenWRT
Από dimangelid στο φόρουμ TP-Link ADSL modems και routersΜηνύματα: 10Τελευταίο Μήνυμα: 20-12-14, 15:43 -
iptables auto ban spam ip's
Από gsan στο φόρουμ Voice over IP (VoIP) SoftwareΜηνύματα: 17Τελευταίο Μήνυμα: 07-08-14, 19:43
Bookmarks