Situation
eth0 -> Internet (123.x.x.x)
eth1 -> Local LAN (10.255.255.254) ; LAN -> 10.0.0.0/8
tun0 -> 10.8.0.1
server.conf
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key # This file should be kept secret
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 182.19.95.66"
push "dhcp-option DNS 182.19.95.34"
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 3
I've enabled net.ipv4.ip_forward = 1 in /etc/sysctl.conf
VPN connection is ok
I can access internet on client machine(windows 7) when it connected to VPN server
I can ping eth1 (10.255.255.254)
but unable to ping other machine on lan (10.0.10.4, 10.0.10.5 etc.)
I have tried these rules but no success
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth0 -o tun0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i tun0 -o eth1 -j ACCEPT
I think it must be problem with iptables. please suggest working iptable rule.