Hello, i'm having an issues reaching internet from my bridged LAN network.
My network is like that one :
http://prntscr.com/cjtf3o
My IP network is:
LAN and remote LAN 192.168.1.0/24 (
Layer2)
@IP of Openvpn server br0 : 192.168.1.254
@IP of Openvpn server WAN : x.y.z.27/28
@IP of my computer/DHCP server in LAN : 192.168.1.200, with GW : 192.168.1.254
result of ifconfig:
itancia@itancia-virtual-machine:~$ ifconfig
br0 Link encap:Ethernet HWaddr 00:50:56:bf:1e:cb
inet adr:192.168.1.254 Bcast:192.168.1.255 Masque:255.255.255.0
adr inet6: fe80::250:56ff:febf:1ecb/64 Scope:Lien
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Packets reçus:186029 erreurs:0 :0 overruns:0 frame:0
TX packets:2686 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
Octets reçus:10599335 (10.5 MB) Octets transmis:233804 (233.8 KB)
ens160 Link encap:Ethernet HWaddr 00:50:56:bf:0b:6a
inet adr: x.y.z.27 Bcast: x.y.z.31 Masque:255.255.255.240
adr inet6: fe80::250:56ff:febf:b6a/64 Scope:Lien
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Packets reçus:544966 erreurs:0 :0 overruns:0 frame:0
TX packets:120323 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
Octets reçus:184966011 (184.9 MB) Octets transmis:25486484 (25.4 MB)
ens192 Link encap:Ethernet HWaddr 00:50:56:bf:1e:cb
adr inet6: fe80::250:56ff:febf:1ecb/64 Scope:Lien
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
Packets reçus:62164 erreurs:0 :0 overruns:0 frame:0
TX packets:218974 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
Octets reçus:9894105 (9.8 MB) Octets transmis:17854255 (17.8 MB)
tap0 Link encap:Ethernet HWaddr 7a:a7:71:04:45:d5
adr inet6: fe80::78a7:71ff:fe04:45d5/64 Scope:Lien
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Packets reçus:6184 erreurs:0 :0 overruns:0 frame:0
TX packets:1288 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:100
Octets reçus:487650 (487.6 KB) Octets transmis:161860 (161.8 KB)
result of cat /etc/network/interfaces:
auto lo
iface lo inet loopback
auto ens160
iface ens160 inet static
address x.x.x.27
netmask 255.255.255.240
gateway x.x.x.30
auto ens192
iface ens192 inet static
auto br0
iface br0 inet static
bridge_ports ens192 tap0
address 192.168.1.254
netmask 255.255.255.0
broadcast 192.168.1.255
dns-nameservers 213.186.33.99 8.8.8.8
And here is my server.conf:
port 1194
proto udp
dev tap0
ca ca.crt
cert server.crt
key server.key # This file should be kept secret
dh dh2048.pem
ifconfig-pool-persist ipp.txt
server-bridge 192.168.1.254 255.255.255.0 192.168.1.10 192.168.1.250
push "route 192.168.1.0 255.255.255.0"
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 213.186.33.99"
push "dhcp-option DNS 8.8.8.8"
client-to-client
keepalive 10 120
tls-auth ta.key 0 # This file is secret
key-direction 0
cipher AES-128-CBC # AES
auth SHA256
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3
Client side config:
client
dev tap0
proto udp
remote x.x.x.27 1194
resolv-retry infinite
nobind
user nobody
group nogroup
persist-key
persist-tun
remote-cert-tls server
cipher AES-128-CBC
auth SHA256
key-direction 1
comp-lzo
verb 3
For the iptables I used in my VPN server who is also the gateway :
iptables -A INPUT -i tap0 -j ACCEPT
iptables -A INPUT -i br0 -j ACCEPT
iptables -A FORWARD -i br0 -j ACCEPT
and that line :
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o br0 -j MASQUERADE
The ip_forward is enable :
cat /proc/sys/net/ipv4/ip_forward
1
But i still can't reach 8.8.8.8 with the client LAN side, I can only ping the x.y.z.27 of my server but not further.
I runned wireshark in the server and I see the ping from my client side but they are not forwarded.
If you have any questions or if i missed something in my configuration please ask me, i will be very grateful.