Page 1 of 1

lan DHCP requests

Posted: Wed Sep 21, 2011 1:02 pm
by goendg
hi

does someone knows how to send/recive lan dhcp request over bridge ? i have 2 sites connected with briged openvpn and i want do recive dhcp to the second site lan from the dhcp server from the first one.
there is my config.


client

dev tap
proto udp
remote 99.99.99.1 11194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
pull
cert client1.crt
key client2.key
ns-cert-type server
tls-auth ta.key 1
cipher AES-128-CBC
comp-lzo
verb 3
route-delay 2

SERVER
port 11194
local 10.0.0.8
proto udp
;dev tun0
dev tap0
;dev-node tap-bridge
daemon
ca ca.crt
cert server.crt
key server.key
dh dh1024.pem
tls-auth ta.key 0
push "route 10.0.0.0 255.255.255.0"
push "dhcp-option DNS 10.0.0.6"
push "dhcp-option DNS 193.231.252.1"
push "redirect-gateway def1"
ifconfig-pool-persist client-adresses.txt
client-to-client
keepalive 10 120
cipher AES-128-CBC
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
log openvpn
verb 3
mute 20

Re: lan DHCP requests

Posted: Wed Sep 21, 2011 9:49 pm
by janjust
this is possible, if the bridge is set up correctly ; you did not use any form of

Code: Select all

server-bridge
server-bridge IP netmask pool
on the server side - check your setup.

Re: lan DHCP requests

Posted: Fri Sep 23, 2011 4:33 am
by goendg
i missed that when i posted . i was really tired .sorry

server-bridge 10.0.0.8 255.255.255.0 10.0.0.150 10.0.0.255

still not working

Re: lan DHCP requests

Posted: Fri Sep 23, 2011 6:47 am
by janjust
change it to simply

Code: Select all

server-bridge
openvpn will no longer assign IPs from a specific pool but will forward the DHCP request to a remote DHCP server. Address assignment is a bit slower in this case, but I've seen it work.

Re: lan DHCP requests

Posted: Fri Sep 23, 2011 3:58 pm
by goendg
i try ur ideea

Code: Select all

port 11194
proto udp
dev tap0
daemon
ca ca.crt
cert server.crt
key server.key
dh dh1024.pem
tls-auth ta.key 0
server-bridge
push "route 10.0.0.0 255.255.255.0"
push "dhcp-option DNS 10.0.0.6"
push "dhcp-option DNS 193.231.252.1"
push "redirect-gateway def1"
ifconfig-pool-persist client-adresses.txt
client-to-client
keepalive 10 120
cipher AES-128-CBC
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
log openvpn
verb 3
mute 20
mssfix 1400
fragment 1400 
and with this conf the tap is not getting up . on the windows lapetop (where the tap/tun is added with the install) it gives ip , but on linux machine ... no . take a look at the openvpn output

Code: Select all

OpenVPN CLIENT LIST
Updated,Fri Sep 23 19:01:32 2011
Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since
craiova,xxx.xx.xx.xx:53063,6532,12001,Fri Sep 23 18:58:43 2011
georgee,yyy.yyy.yyy.yyy:65156,132118,107669,Fri Sep 23 18:48:44 2011
ROUTING TABLE
Virtual Address,Common Name,Real Address,Last Ref
00:ff:0d:6e:94:ab,georgee,xxx.xx.xx.xx:65156,Fri Sep 23 19:01:06 2011
GLOBAL STATS
Max bcast/mcast queue length,3
END

Re: lan DHCP requests

Posted: Sun Sep 25, 2011 4:14 pm
by goendg
what else do u think i should do

Re: lan DHCP requests

Posted: Wed Oct 12, 2011 10:13 am
by tushar.sharma
On windows it takes I.P automatically while on linux you need to run dhcp client
such as dhclient tap0 that will broadcast dhcp request to dhcp server.

I was facing same problem, and soved it by running dhclient tap0
on client side.


Thanking You

===========================================


Tushar