Lieber Besucher, herzlich willkommen bei: Linux Forum Linux-Web.de. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
iptables -A PREROUTING -t nat -i eth1 -p tcp --dport 80 -j DNAT --to 172.16.0.29:80 iptables -A INPUT -p tcp -m state --state NEW --dport 80 -i eth0 -j ACCEPT iptables -t nat -A PREROUTING -p tcp -i eth1 --dport 80 -j DNAT --to 172.16.0.29:80 iptables -A FORWARD -p tcp -i eth1 -d 172.16.0.29 --dport 80 -j ACCEPT iptables -A FORWARD -i eth1 -m state --state NEW -p tcp --dport 80 -j ACCEPT iptables -A PREROUTING -t nat -p tcp -i eth1 --dport 80 -j DNAT --to 172.16.0.29 iptables -A FORWARD -i eth0 -o eth1 -d 172.16.0.29 -p tcp --dport 80 -j ACCEPT iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to 172.16.0.29 iptables -A FORWARD -i $EXTIF -o $INTIF -d 172.16.0.29 -p tcp --dport 80 -j ACCEPT iptables -t nat -A PREROUTING -i $EXTIF -d $EXTIP -p tcp --dport 80 -j DNAT --to 172.16.0.29 Chain INPUT (policy DROP) target prot opt source destination ACCEPT all -- anywhere anywhere LOG all -- 127.0.0.0/8 anywhere LOG level warning DROP all -- 127.0.0.0/8 anywhere ACCEPT all -- anywhere 255.255.255.255 ACCEPT all -- 172.16.0.0/27 anywhere ACCEPT !tcp -- anywhere BASE-ADDRESS.MCAST.NET/4 LOG all -- 172.16.0.0/27 anywhere LOG level warning DROP all -- 172.16.0.0/27 anywhere ACCEPT all -- anywhere 255.255.255.255 ACCEPT all -- anywhere 192.168.0.79 ACCEPT all -- anywhere 192.168.0.255 LOG all -- anywhere anywhere LOG level warning DROP all -- anywhere anywhere ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:www ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:www ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:www Chain FORWARD (policy DROP) target prot opt source destination ACCEPT all -- 172.16.0.0/27 anywhere ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED LOG all -- anywhere 172.16.0.0/27 LOG level warning DROP all -- anywhere 172.16.0.0/27 LOG all -- anywhere anywhere LOG level warning DROP all -- anywhere anywhere ACCEPT tcp -- anywhere 172.16.0.29 tcp dpt:www ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:www ACCEPT tcp -- anywhere 172.16.0.29 tcp dpt:www ACCEPT tcp -- anywhere 172.16.0.29 tcp dpt:www ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED Chain OUTPUT (policy DROP) target prot opt source destination ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere 255.255.255.255 ACCEPT all -- anywhere 172.16.0.0/27 ACCEPT !tcp -- anywhere BASE-ADDRESS.MCAST.NET/4 LOG all -- anywhere 172.16.0.0/27 LOG level warning DROP all -- anywhere 172.16.0.0/27 ACCEPT all -- anywhere 255.255.255.255 ACCEPT all -- 192.168.0.79 anywhere ACCEPT all -- 192.168.0.255 anywhere LOG all -- anywhere anywhere LOG level warning DROP all -- anywhere anywhere |
Quellcode |
|
1 2 3 |
# > /usr/sbin/iptables -P INPUT DROP # > /usr/sbin/iptables -P OUTPUT DROP # > /usr/sbin/iptables -P FORWARD DROP |
Quellcode |
|
1 2 3 4 |
# > INTERN=eth0 # > EXTERN=eth1 # > /usr/sbin/iptables -A INPUT -i $EXTERN -p icmp -d 172.16.0.0/24 -s 192.168.0.0/24 -j ACCEPT # > /usr/sbin/iptables -A OUTPUT -o $EXTERN -p icmp -s 172.16.0.0/24 -d 192.168.0.0/24 -j ACCEPT |
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »BorneBjoern« (27.03.2008, 15:19)
Zitat
Ich möchte nun, wenn ich an meinem Arbeitsplatz im Firmennetz im Browser die 192.168.0.79 eingebe, auf die 172.16.0.29 weitergeleitet werden, sodass ich auf Weboberfläche des APs gelange.
Benutzerinformationen überspringen
Prof. Dr. Schlaumeier
Wohnort: Mecklenburg, zur Entwicklungshilfe in Chemnitz/Sachsen ;-)
Zitat
Ich möchte nun, wenn ich an meinem Arbeitsplatz im Firmennetz im Browser die 192.168.0.79 eingebe, auf die 172.16.0.29 weitergeleitet werden, sodass ich auf Weboberfläche des APs gelange.
Ich hoffe, dass die Sachlage nun klar ist
Zitat
setze doch einfach eine route in das 172.16.0.0/27 netzwerk auf dem router (das sollte bereits so sein, denn ansonsten koenntest du die Rechner in diesem netz nicht anpingen)
Zitat
und warum willst du das?
es ist doch viel sinnvoller, dass du in deinem browser 172.16.0.29 eingibst und dann auf dem ap bist, wozu soll die umstellung der ip gut sein?
Zitat
iptables -t nat -A PREROUTING -p tcp -i eth0 -d 192.168.0.79 --dport 80 -j DNAT --to 172.16.0.29:80
iptables -A FORWARD -p tcp -i eth0 -d 172.16.0.29 --dport 80 -j ACCEPT
Zitat
Ich bin bisher davon ausgegangen, dass wenn ich (als Teilnehmer im 192.. Netz) eine 172.. Adresse aufrufe, mein Rechner gar nicht weiß wo der Host mit dieser Adresse liegen soll.
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »BorneBjoern« (28.03.2008, 11:10)
Zitat
Genau diese Befehle hatte ich so schonmal reingehauen, das hatte aber nicht funktioniert.
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 |
Chain PREROUTING (policy ACCEPT 126K packets, 12M bytes) pkts bytes target prot opt in out source destination 3 144 DNAT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 to:172.16.0.29 Chain POSTROUTING (policy ACCEPT 731 packets, 119K bytes) pkts bytes target prot opt in out source destination 578 93166 MASQUERADE all -- * eth0 0.0.0.0/0 0.0.0.0/0 Chain OUTPUT (policy ACCEPT 1168 packets, 208K bytes) pkts bytes target prot opt in out source destination |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
Chain INPUT (policy DROP) target prot opt source destination ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT icmp -- anywhere anywhere state NEW icmp echo-request ACCEPT tcp -- anywhere anywhere tcp dpt:ssh Chain FORWARD (policy ACCEPT) target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp dpt:www TCPMSS tcp -- anywhere anywhere tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT all -- anywhere anywhere Chain OUTPUT (policy ACCEPT) target prot opt source destination ACCEPT all -- anywhere anywhere |
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »giz« (31.03.2008, 08:28)
Quellcode |
|
1 2 |
# > iptables -A INPUT -i {NIC mit dem 172. Netz} -p tcp -dport 80 -d 192.168.0.0/24 -s 172.16.0.29 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT # > iptables -A OUTPUT -i {NIC mit dem 172. Netz} -p tcp -dport 80 -d 172.16.0.29 -s 192.168.0.0/24 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT |
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »BorneBjoern« (31.03.2008, 09:05)
Zitat
Wenn tcpdump nichts anzeigt, ist das Routing noch verkehrt. Aber da waere ein Post der Ausgabe nicht verkehrt...
Quellcode |
|
1 2 3 4 5 6 |
wrouter:~# tcpdump -i eth1 tcp port 80 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes 14:03:58.150968 IP 192.168.0.196.l2f > 172.16.0.29.www: S 3654677241:3654677241(0) win 65535 <mss 1460,nop,nop,sackOK> 14:04:01.128670 IP 192.168.0.196.l2f > 172.16.0.29.www: S 3654677241:3654677241(0) win 65535 <mss 1460,nop,nop,sackOK> 14:04:07.144342 IP 192.168.0.196.l2f > 172.16.0.29.www: S 3654677241:3654677241(0) win 65535 <mss 1460,nop,nop,sackOK> |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
wrouter:~# tcpdump -i eth1 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes 14:02:03.880692 IP 172.16.0.30.32779 > 172.16.0.29.www: P 3604736900:3604737154(254) ack 3690663871 win 5840 <nop,nop,timestamp 502574841 146803> 14:02:03.970759 IP 172.16.0.29.www > 172.16.0.30.32779: R 3690663871:3690663871(0) win 0 14:02:08.877908 arp who-has 172.16.0.29 tell 172.16.0.30 14:02:08.878265 arp reply 172.16.0.29 is-at 00:1e:2a:5d:87:50 (oui Unknown) 14:02:27.965146 IP 172.16.0.30.32780 > 172.16.0.29.www: S 3700754944:3700754944(0) win 5840 <mss 1460,sackOK,timestamp 502598931 0,nop,wscale 0> 14:02:27.965870 IP 172.16.0.29.www > 172.16.0.30.32780: S 3714023869:3714023869(0) ack 3700754945 win 8192 <mss 1460,nop,wscale 0,nop,nop,timestamp 146983 502598931> 14:02:27.965928 IP 172.16.0.30.32780 > 172.16.0.29.www: . ack 1 win 5840 <nop,nop,timestamp 502598931 146983> 14:02:27.970027 IP 172.16.0.30.32780 > 172.16.0.29.www: P 1:255(254) ack 1 win 5840 <nop,nop,timestamp 502598936 146983> 14:02:27.970766 IP 172.16.0.29.www > 172.16.0.30.32780: . ack 255 win 8192 <nop,nop,timestamp 146983 502598936> 14:02:27.972719 IP 172.16.0.29.www > 172.16.0.30.32780: P 1:67(66) ack 255 win 8192 <nop,nop,timestamp 146983 502598936> 14:02:27.972797 IP 172.16.0.30.32780 > 172.16.0.29.www: . ack 67 win 5840 <nop,nop,timestamp 502598938 146983> 14:02:27.973543 IP 172.16.0.29.www > 172.16.0.30.32780: P 67:1067(1000) ack 255 win 8192 <nop,nop,timestamp 146983 502598938> 14:02:27.973588 IP 172.16.0.30.32780 > 172.16.0.29.www: . ack 1067 win 7000 <nop,nop,timestamp 502598939 146983> 14:02:27.974168 IP 172.16.0.29.www > 172.16.0.30.32780: FP 1067:1399(332) ack 255 win 8192 <nop,nop,timestamp 146983 502598938> 14:02:27.983026 IP 172.16.0.30.32780 > 172.16.0.29.www: F 255:255(0) ack 1400 win 9000 <nop,nop,timestamp 502598949 146983> 14:02:27.983567 IP 172.16.0.29.www > 172.16.0.30.32780: . ack 256 win 8192 <nop,nop,timestamp 146983 502598949> |
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »BorneBjoern« (03.04.2008, 12:38)