Re: openVPN bridge und DHCP server
Sven Hartge schrieb:
iface eth0 inet static
address 192.168.61.2
network 192.168.61.0
netmask 255.255.255.0
broadcast 192.168.61.255
auto tap0
iface tap0 inet manual
pre-up openvpn --mktun --dev tap0
post-down openvpn --rmtun --dev tap0
address 0.0.0.0
auto br0
iface br0 inet static
address 192.168.61.2
network 192.168.61.0
netmask 255.255.255.0
broadcast 192.168.61.255
bridge_ports eth0 tap0
Ich muss sagen, das ist aber Kappes. eth0 braucht keine Konfiguration
mit IP, da eth ja später ein Teil von br0 wird. Und auch "address
0.0.0.0" bei tap0 ist aus gleichem Grund sinnlos.
Beispiel:
# VLAN 421 (Verwaltung)
auto br421
iface br421 inet manual
bridge_ports eth0.421 tap421
pre-up openvpn --mktun --dev tap421
post-down openvpn --rmtun --dev tap421 || true
Mehr braucht es nicht. Das verbindet ein Interface im VLAN 421 mit dem
tap421. Ich brauche keine Extra-Einträge für tap421 noch für eth0.421.
Die Scripte regeln dies alles automagisch.
ok mit
#vpn brige
auto br0
iface br0 inet static
address 192.168.1.1
netmask 255.255.255.0
broadcast 192.168.1.255
network 192.168.1.0
bridge_ports eth0 tap0
pre-up openvpn --mktun --dev tap0
post-down openvpn --rmtun --dev tap0 || true
kommt das raus
ifconfig
br0 Protokoll:Ethernet Hardware Adresse 00:60:08:63:09:1B
inet Adresse:192.168.1.1 Bcast:192.168.1.255 Maske:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:122 errors:0 dropped:0 overruns:0 frame:0
TX packets:100 errors:0 dropped:0 overruns:0 carrier:0
Kollisionen:0 Sendewarteschlangenl�nge:0
RX bytes:26056 (25.4 KiB) TX bytes:11093 (10.8 KiB)
eth0 Protokoll:Ethernet Hardware Adresse 00:60:08:63:09:1B
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:124 errors:0 dropped:0 overruns:0 frame:0
TX packets:100 errors:0 dropped:0 overruns:0 carrier:0
Kollisionen:0 Sendewarteschlangenl�nge:1000
RX bytes:28166 (27.5 KiB) TX bytes:11633 (11.3 KiB)
Interrupt:9 Basisadresse:0x20c0
eth1 Protokoll:Ethernet Hardware Adresse 00:01:03:16:C5:43
---
lo Protokoll:Lokale Schleife
---
ppp0 Protokoll:Punkt-zu-Punkt Verbindung
---
tap0 Protokoll:Ethernet Hardware Adresse 42:C3:AA:3E:83:34
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:222 overruns:0 carrier:0
Kollisionen:0 Sendewarteschlangenl�nge:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
squid samba und ntp schauen auch anscheinend auf dem richtigen interface.
beim dhcp bin ich mir nicht sicher da ich im syslog nur fehler sehe und nicht wo er lauscht.
logischer weise bringt er mir wieder das hier muss er ja auch
cat syslog
dhcpd: No subnet declaration for eth0 (0.0.0.0).
in den iptables steht unter anderem drin:
iptables -A INPUT -i eth0 -j ACCEPT
iptables -A INPUT -i br0 -j ACCEPT
iptables -A INPUT -i tap0 -j ACCEPT
iptables -A FORWARD -i br0 -j ACCEPT
# Masquerade.
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
# Enable routing.
echo 1 > /proc/sys/net/ipv4/ip_forward
leider scheint die Weiterleitung nicht zu klappen
PING 192.168.1.14 (192.168.1.14) 56(84) bytes of data.
From 192.168.1.1 icmp_seq=1 Destination Host Unreachable
PING 192.168.1.15 (192.168.1.15) 56(84) bytes of data.
From 192.168.1.1 icmp_seq=1 Destination Host Unreachable
usw.
die hosts wahre vor dem neustart noch alle erreichbar.
und dhcp einträge giebt es auch keine mehr im syslog.
hab es erst mal wieder umgestellt (ohne bridge) bis es weitere Erkenntnisse gibt.
benni
Reply to: