Brief description of network and setup:
I have an OpenVPN server running in TAP mode on a Linux server.
tap0 is bridged with eth0 (the server's LAN interface) into br0.
Two client sites connect and results in one big LAN in the same /16 subnet.
192.168.0.0/16 is used on the LAN on the server's side of the bridge.
192.168.10.0/16 is used at client A's side of the bridge.
192.168.20.0/16 is used at client B's side of the bridge.
Each site as a router on .254 following the above convention that handles DHCP and general Internet access.
OpenVPN at each site is hosted on systems separate from those routers.
The issue:
All is well except for one small thing. While I can prevent DHCP traffic from crossing over to either of the client and the server's side of the bridge using the following ebtables rules:
ebtables -A INPUT -i tap0 -p ipv4 --ip-protocol udp --ip-destination-port 67:68 -j DROP
ebtables -A INPUT -i tap0 -p ipv4 --ip-protocol udp --ip-source-port 67:68 -j DROP
The problem is DHCP traffic still some how makes it between the two client sites; nodes on one client configured for DHCP sometimes get an IP from the router on the other client's side of the bridge.
I tried adding the following to prevent that but doesn't seem to change anything:
ebtables -A FORWARD -o tap0 -p ipv4 --ip-protocol udp --ip-destination-port 67:68 -j DROP
ebtables -A FORWARD -o tap0 -p ipv4 --ip-protocol udp --ip-source-port 67:68 -j DROP
tcpdump still shows it going through:
# tcpdump -vv -n -i tap0 | ack '\.(bootp[sc]|6[78])\b'
tcpdump: listening on tap0, link-type EN10MB (Ethernet), capture size 262144 bytes
192.168.10.5.68 > 255.255.255.255.67: [udp sum ok] BOOTP/DHCP, Request from de:a2:93:b6:f6:29, length 244, xid 0xe1c9b9a9, Flags [Broadcast] (0x8000)
192.168.20.250.67 > 255.255.255.255.68: [udp sum ok] BOOTP/DHCP, Reply, length 323, xid 0xe1c9b9a9, Flags [Broadcast] (0x8000)
192.168.10.254.67 > 255.255.255.255.68: [udp sum ok] BOOTP/DHCP, Reply, length 274, xid 0xe1c9b9a9, Flags [Broadcast] (0x8000)
Thanks for any help.
---
Server config looks like this:mode server
proto udp
port 1194
dev tap0
keepalive 10 120
daemon
comp-lzo
max-clients 16
user nobody
group nobody
persist-key
persist-tun
client-to-client
log-append /var/log/openvpn.log
status /var/run/openvpn/status-server-tap
verb 3
mute 20
tls-server
tls-auth ...../ta.key 0
cipher BF-CBC
ca ...../ca.crt
cert ...../server.crt
key ...../server.key
dh ...../dh1024.pem
up /etc/openvpn/bridge-start
down /etc/openvpn/bridge-stop
Clients configs look like this:client
proto udp
dev-node tap0
remote <server's ip address> 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ns-cert-type server
comp-lzo
verb 3
mute 20
script-security 2
cipher BF-CBC
ca CA/ca.crt
cert certs/client.crt
key private/client.key
tls-auth keys/ta.key 1
up "C:\\Program\ Files\\OpenVPN\\config\\up.bat"
up-restart