| Linux/UNIX Linuxverfechter finden hier Weggefährten. |
Diskussion: Basic Routing: Wo liegt hier mein Denkfehler? im Forum Linux/UNIX, in der Kategorie Operating Systems; Anzeige Hi, ich habe momentan 2 Netze: 10.0.0.0/24 und 192.168.1.0/24. In dem 10er Netz hängen mein Gateway ins Internet und ...
![]() |
| | #1 (permalink) |
| Senior Member Registriert seit: 26.03.06 ![]() Likes: 16 | Anzeige Hi, ich habe momentan 2 Netze: 10.0.0.0/24 und 192.168.1.0/24. In dem 10er Netz hängen mein Gateway ins Internet und meine Workstations. Die sind durch ein Debian vom 192er Netz getrennt. Wenn ich jetzt von der 10.0.0.249 die 192.168.1.10 pingen will geht das erstmal nicht, da die Pings an das default gateway gehen und das weiss nicht wo das Netz ist. Also hab ich dem Gateway eine Route verpasst: Code: root@gateway:~# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 188.105.224.1 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0 10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 br-lan 192.168.1.0 10.0.0.110 255.255.255.0 UG 0 0 0 br-lan 0.0.0.0 188.105.224.1 0.0.0.0 UG 0 0 0 ppp0 root@gateway:~# Folgende Pings gehen jetzt: 10.0.0.249 -> 10.0.0.1 10.0.0.249 -> 10.0.0.110 10.0.0.1 -> 10.0.0.110 10.0.0.110 bzw 192.168.1.1 -> 192.168.1.10 Ich dachte, die 10.0.0.249 müsste jetzt den Ping an die 10.0.0.1 schicken und die wiederum an die 10.0.0.110. Die 10.0.0.110 hat IP forwarding eingeschalten (/proc/sys/net/ipv4/ip_forward = 1). Und die Route zurück müsste ja auch da sein, denn die 192.168.1.10 schickt die Antwort ja über ihr default gw (also die 192.168.1.1). Dennoch klappt keine Pings aus dem 10er Netz is 192er Netz. Wieso? EDIT: Achja und der Rechner im 192er Netz kann die 10.0.0.1 pingen, nicht aber die 10.0.0.249. cu serow Geändert von Serow (17.02.10 um 17:44 Uhr) |
| | |
| | #2 (permalink) |
| Senior Member Themenstarter Registriert seit: 26.03.06 ![]() Likes: 16 | Hi, mein Denkfehler lag in der Annahme, dass die IP 10.0.0.110 frei wäre => IP Konflikt. Das war aber nur der erste Streich: Wenn ich vom Rechner "mini" (10.0.0.249) einen ping an den "lab-router-1" (10.0.0.60) schicke, sieht so der tcpdump Output auf "mini" aus: Der Ping muss übrigens noch durch eine WLAN bridge namens "bridge". Code: [MAC von mini] [MAC von bridge] [IP mini] [IP lab-router-1]
21:58:43.593102 00:25:00:f6:c2:e8 > 00:25:9c:4b:0f:8a, ethertype IPv4 (0x0800), length 98: 10.0.0.249 > 10.0.0.60: ICMP echo request, id 25622, seq 1, length 64
[MAC von bridge] [MAC von mini] [IP lab-router-1] [IP mini]
21:58:43.595473 00:25:9c:4b:0f:8a > 00:25:00:f6:c2:e8, ethertype IPv4 (0x0800), length 98: 10.0.0.60 > 10.0.0.249: ICMP echo reply, id 25622, seq 1, length 64 Code: [MAC von mini] [MAC von bridge] [IP mini] [IP lab-router-1 (inner)] 22:05:10.611859 00:25:00:f6:c2:e8 > 00:25:9c:4b:0f:8a, ethertype IPv4 (0x0800), length 98: 10.0.0.249 > 192.168.1.1: ICMP echo request, id 32278, seq 1, length 64 Code: [MAC von mini] [MAC von bridge] [IP mini] [IP lab-router-1 (inner)] 21:07:06.994049 00:25:00:f6:c2:e8 > 00:25:9c:4b:0f:8a, ethertype IPv4 (0x0800), length 98: 10.0.0.249 > 192.168.1.1: ICMP echo request, id 33302, seq 1, length 64 Jetzt ist für mich die große Frage warum "bridge" den Ping verschluckt! Dazu fehlt mir vllt das Verständnis für das was das Linux da tut: Hier erstmal eine Übersicht über die interfaces, die "bridge" hat: Code: root@bridge:~# ifconfig -a
br-lan Link encap:Ethernet HWaddr 00:25:9C:4B:0F:88
inet addr:10.0.0.2 Bcast:10.0.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:30870 errors:0 dropped:0 overruns:0 frame:0
TX packets:3011 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1249010 (1.1 MiB) TX bytes:520276 (508.0 KiB)
eth0 Link encap:Ethernet HWaddr 00:25:9C:4B:0F:88
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:230175 errors:0 dropped:0 overruns:0 frame:0
TX packets:253553 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:89860880 (85.6 MiB) TX bytes:60477844 (57.6 MiB)
Interrupt:4
eth0.0 Link encap:Ethernet HWaddr 00:25:9C:4B:0F:88
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:230175 errors:0 dropped:0 overruns:0 frame:0
TX packets:253553 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:85717730 (81.7 MiB) TX bytes:59194984 (56.4 MiB)
eth0.1 Link encap:Ethernet HWaddr 00:25:9C:4B:0F:88
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
imq0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
NOARP MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:30
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
imq1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
NOARP MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:30
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:96 (96.0 B) TX bytes:96 (96.0 B)
wl0 Link encap:Ethernet HWaddr 00:25:9C:4B:0F:8A
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:257982 errors:0 dropped:0 overruns:0 frame:230624
TX packets:235158 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:58533332 (55.8 MiB) TX bytes:90523617 (86.3 MiB)
Interrupt:2 Base address:0x5000
root@bridge:~# Code: root@bridge:~# brctl show
bridge name bridge id STP enabled interfaces
br-lan 8000.00259c4b0f88 no eth0.0
wl0
root@bridge:~# Code: root@bridge:~# logread | grep eth0 Jan 1 00:00:08 bridge user.info kernel: eth0: Broadcom 47xx 10/100BaseT Ethernet 00:25:9c:4b:0f:88 Jan 1 00:00:08 bridge user.info kernel: b44: eth0: Link is up at 100 Mbps, full duplex. Jan 1 00:00:08 bridge user.info kernel: b44: eth0: Flow control is off for TX and off for RX. Jan 1 00:00:08 bridge user.info kernel: roboswitch: Probing device eth0: found! Jan 1 00:00:11 bridge user.info kernel: b44: eth0: Link is up at 100 Mbps, full duplex. Jan 1 00:00:11 bridge user.info kernel: b44: eth0: Flow control is off for TX and off for RX. Jan 1 00:00:12 bridge user.debug kernel: eth0.0: add 01:00:5e:00:00:01 mcast address to master interface Jan 1 00:00:13 bridge user.info kernel: eth0.0: dev_set_promiscuity(master, 1) Jan 1 00:00:13 bridge user.info kernel: device eth0 entered promiscuous mode Jan 1 00:00:13 bridge user.info kernel: device eth0.0 entered promiscuous mode Jan 1 00:00:13 bridge user.info kernel: br-lan: port 1(eth0.0) entering learning state Jan 1 00:00:13 bridge user.info kernel: br-lan: port 1(eth0.0) entering forwarding state Feb 17 15:58:06 bridge user.notice root: adding wan (eth0.1) to firewall zone wan root@bridge:~# Code: root@bridge:~# iptables -L -v
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 DROP all -- any any anywhere anywhere state INVALID
3093 187K ACCEPT all -- any any anywhere anywhere state RELATED,ESTABLISHED
0 0 ACCEPT all -- lo any anywhere anywhere
1087 65220 syn_flood tcp -- any any anywhere anywhere tcp flags:FIN,SYN,RST,ACK/SYN
2861 218K input_rule all -- any any anywhere anywhere
2861 218K input all -- any any anywhere anywhere
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 zone_wan_MSSFIX all -- any any anywhere anywhere
0 0 DROP all -- any any anywhere anywhere state INVALID
0 0 ACCEPT all -- any any anywhere anywhere state RELATED,ESTABLISHED
0 0 forwarding_rule all -- any any anywhere anywhere
0 0 forward all -- any any anywhere anywhere
0 0 reject all -- any any anywhere anywhere
Chain OUTPUT (policy ACCEPT 3 packets, 220 bytes)
pkts bytes target prot opt in out source destination
0 0 DROP all -- any any anywhere anywhere state INVALID
3505 575K ACCEPT all -- any any anywhere anywhere state RELATED,ESTABLISHED
0 0 ACCEPT all -- any lo anywhere anywhere
37 2820 output_rule all -- any any anywhere anywhere
37 2820 output all -- any any anywhere anywhere
Chain forward (1 references)
pkts bytes target prot opt in out source destination
0 0 zone_lan_forward all -- br-lan any anywhere anywhere
0 0 zone_wan_forward all -- eth0.1 any anywhere anywhere
Chain forwarding_lan (1 references)
pkts bytes target prot opt in out source destination
Chain forwarding_rule (1 references)
pkts bytes target prot opt in out source destination
Chain forwarding_wan (1 references)
pkts bytes target prot opt in out source destination
Chain input (1 references)
pkts bytes target prot opt in out source destination
2861 218K zone_lan all -- br-lan any anywhere anywhere
0 0 zone_wan all -- eth0.1 any anywhere anywhere
Chain input_lan (1 references)
pkts bytes target prot opt in out source destination
Chain input_rule (1 references)
pkts bytes target prot opt in out source destination
Chain input_wan (1 references)
pkts bytes target prot opt in out source destination
Chain output (1 references)
pkts bytes target prot opt in out source destination
37 2820 zone_lan_ACCEPT all -- any any anywhere anywhere
3 220 zone_wan_ACCEPT all -- any any anywhere anywhere
Chain output_rule (1 references)
pkts bytes target prot opt in out source destination
Chain reject (5 references)
pkts bytes target prot opt in out source destination
0 0 REJECT tcp -- any any anywhere anywhere reject-with tcp-reset
0 0 REJECT all -- any any anywhere anywhere reject-with icmp-port-unreachable
Chain syn_flood (1 references)
pkts bytes target prot opt in out source destination
1047 62820 RETURN tcp -- any any anywhere anywhere tcp flags:FIN,SYN,RST,ACK/SYN limit: avg 25/sec burst 50
40 2400 DROP all -- any any anywhere anywhere
Chain zone_lan (1 references)
pkts bytes target prot opt in out source destination
2861 218K input_lan all -- any any anywhere anywhere
2861 218K zone_lan_ACCEPT all -- any any anywhere anywhere
Chain zone_lan_ACCEPT (2 references)
pkts bytes target prot opt in out source destination
2861 218K ACCEPT all -- br-lan any anywhere anywhere
34 2600 ACCEPT all -- any br-lan anywhere anywhere
Chain zone_lan_DROP (0 references)
pkts bytes target prot opt in out source destination
0 0 DROP all -- br-lan any anywhere anywhere
0 0 DROP all -- any br-lan anywhere anywhere
Chain zone_lan_MSSFIX (0 references)
pkts bytes target prot opt in out source destination
0 0 TCPMSS tcp -- any br-lan anywhere anywhere tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU
Chain zone_lan_REJECT (1 references)
pkts bytes target prot opt in out source destination
0 0 reject all -- br-lan any anywhere anywhere
0 0 reject all -- any br-lan anywhere anywhere
Chain zone_lan_forward (1 references)
pkts bytes target prot opt in out source destination
0 0 zone_wan_ACCEPT all -- any any anywhere anywhere
0 0 forwarding_lan all -- any any anywhere anywhere
0 0 zone_lan_REJECT all -- any any anywhere anywhere
Chain zone_wan (1 references)
pkts bytes target prot opt in out source destination
0 0 ACCEPT udp -- any any anywhere anywhere udp dpt:68
0 0 input_wan all -- any any anywhere anywhere
0 0 zone_wan_REJECT all -- any any anywhere anywhere
Chain zone_wan_ACCEPT (2 references)
pkts bytes target prot opt in out source destination
0 0 ACCEPT all -- eth0.1 any anywhere anywhere
0 0 ACCEPT all -- any eth0.1 anywhere anywhere
Chain zone_wan_DROP (0 references)
pkts bytes target prot opt in out source destination
0 0 DROP all -- eth0.1 any anywhere anywhere
0 0 DROP all -- any eth0.1 anywhere anywhere
Chain zone_wan_MSSFIX (1 references)
pkts bytes target prot opt in out source destination
0 0 TCPMSS tcp -- any eth0.1 anywhere anywhere tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU
Chain zone_wan_REJECT (2 references)
pkts bytes target prot opt in out source destination
0 0 reject all -- eth0.1 any anywhere anywhere
0 0 reject all -- any eth0.1 anywhere anywhere
Chain zone_wan_forward (1 references)
pkts bytes target prot opt in out source destination
0 0 forwarding_wan all -- any any anywhere anywhere
0 0 zone_wan_REJECT all -- any any anywhere anywhere
root@bridge:~# cu serow |
| | |
![]() |
| - Anzeige - | |
| |
| Themen-Optionen | |
| Ansicht | |
| |