Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netzwerk Bridge leitet Pakete nicht weiter #128

Closed
runningman84 opened this issue Aug 3, 2017 · 1 comment
Closed

Netzwerk Bridge leitet Pakete nicht weiter #128

runningman84 opened this issue Aug 3, 2017 · 1 comment

Comments

@runningman84
Copy link

Ich versuche auf meinem RPI 3 mit Rasbian 8 YAHM zu betreiben.

Leider funktioniert das Netzwerk nicht richtig. Das ist die Host Konfiguration:

root@hass:~# brctl show
bridge name     bridge id               STP enabled     interfaces
docker0         8000.024269807f8d       no
yahmbr0         8000.b827ebddb7ae       no              eth0

root@hass:~# ifconfig 
docker0   Link encap:Ethernet  HWaddr 02:42:69:80:7f:8d  
          inet addr:172.17.0.1  Bcast:0.0.0.0  Mask:255.255.0.0
          UP BROADCAST 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)

eth0      Link encap:Ethernet  HWaddr b8:27:eb:dd:b7:ae  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3364453 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5355048 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1300367707 (1.2 GiB)  TX bytes:629769486 (600.5 MiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:1927873 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1927873 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:160683766 (153.2 MiB)  TX bytes:160683766 (153.2 MiB)

veth9YEATQ Link encap:Ethernet  HWaddr fe:38:be:1d:97:2b  
          inet6 addr: fe80::fc38:beff:fe1d:972b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10499 errors:0 dropped:0 overruns:0 frame:0
          TX packets:915151 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:964158 (941.5 KiB)  TX bytes:40049851 (38.1 MiB)

wlan0     Link encap:Ethernet  HWaddr b8:27:eb:88:e2:fb  
          UP BROADCAST 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:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

yahmbr0   Link encap:Ethernet  HWaddr b8:27:eb:dd:b7:ae  
          inet addr:192.168.178.12  Bcast:192.168.178.255  Mask:255.255.255.0
          inet6 addr: fe80::ba27:ebff:fedd:b7ae/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3374788 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5328608 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1293225853 (1.2 GiB)  TX bytes:567838188 (541.5 MiB)

Komischerweise setzt der Container eine IP-Adresse aus einem falschen Netzwerk:

root@hass:~# yahm-ctl info
YAHM Version: 1.7

LXC container information
Name:           yahm
State:          RUNNING
PID:            20902
IP:             192.168.1.225
CPU use:        1.37 seconds
BlkIO use:      124.00 KiB
Memory use:     5.57 MiB
KMem use:       2.65 MiB
Link:           vethJQKY9B
 TX bytes:      2.84 KiB
 RX bytes:      26.24 KiB
 Total bytes:   29.07 KiB

root@hass:~# yahm-ctl join
Joining LXC container, you are now inside yahm
/ # ifconfig 
eth0      Link encap:Ethernet  HWaddr 4A:49:43:49:79:91  
          inet addr:192.168.1.225  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::4849:43ff:fe49:7991/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1409 errors:0 dropped:0 overruns:0 frame:0
          TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:62206 (60.7 KiB)  TX bytes:3044 (2.9 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:110 errors:0 dropped:0 overruns:0 frame:0
          TX packets:110 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:18878 (18.4 KiB)  TX bytes:18878 (18.4 KiB)

/ # route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
/ # ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
^C
--- 192.168.1.1 ping statistics ---
3 packets transmitted, 0 packets received, 100% packet loss

Diesen IP-Kreis gibt es aber bei mir gar nicht.

Wenn ich nun versuche eine IP-Adresse manuell zu setzen kann ich zwar den Host anpingen, aber keine anderen Geräte im Netzwerk:

/ # ifconfig eth0 192.168.178.13
/ # ifconfig 
eth0      Link encap:Ethernet  HWaddr 4A:49:43:49:79:91  
          inet addr:192.168.178.13  Bcast:192.168.178.255  Mask:255.255.255.0
          inet6 addr: fe80::4849:43ff:fe49:7991/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3448 errors:0 dropped:0 overruns:0 frame:0
          TX packets:38 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:154332 (150.7 KiB)  TX bytes:4572 (4.4 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:189 errors:0 dropped:0 overruns:0 frame:0
          TX packets:189 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:38340 (37.4 KiB)  TX bytes:38340 (37.4 KiB)

/ # route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.178.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
/ # ping 192.168.178.12
PING 192.168.178.12 (192.168.178.12): 56 data bytes
64 bytes from 192.168.178.12: seq=0 ttl=64 time=0.432 ms
64 bytes from 192.168.178.12: seq=1 ttl=64 time=0.147 ms
^C
--- 192.168.178.12 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.147/0.289/0.432 ms
/ # ping 192.168.178.11
PING 192.168.178.11 (192.168.178.11): 56 data bytes
^C
--- 192.168.178.11 ping statistics ---
4 packets transmitted, 0 packets received, 100% packet loss

Was muss ich anpassen damit der Container über die Bridge in mein LAN kommt?

@runningman84
Copy link
Author

Das Problem liegt an der Bridge Firewall welche auf meinem System per Default aktiv war.

https://unix.stackexchange.com/questions/136918/why-does-my-firewall-iptables-interfere-in-my-bridge-brctl

Folgendes Kommando daktiviert iptables für die Bridge:

sysctl -w net.bridge.bridge-nf-call-iptables=0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant