Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
problem with openvpn + tap0 + dhcpcd
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
mostro
n00b
n00b


Joined: 20 May 2005
Posts: 26

PostPosted: Thu Jan 12, 2006 4:14 am    Post subject: problem with openvpn + tap0 + dhcpcd Reply with quote

Hi all:
I configured openvpn+tap to secure my home wireless network. Everything works really well, but I have a problem I have not been able to figure out. Actually, two problems:

1. When my gentoo system (laptop) boots, the net.tap0 service will not start properly because the dhcpcd daemon can not contact the dhcp server. This is happening, because openvpn is not running yet (of course). If openvpn starts before the net.tap0 interface, then the net.tap0 interface does not start iether, it just does not give an error or anything. Basicly, I need a way to start net.tap0 (with the dhcpcd daemon running in the background) and then start openvpn. Or some other solution...
I can get it to work with something like this:
#!/bin/bash

# create the tap interface:
tunctl

# start dhcpcd on it:
dhcpcd tap0 &

# Now, start openvpn:
/etc/init.d/openvpn start

# End of script.

I just don't know how to make the Gentoo rc scripts du it. Any ideas on how to get this working?


2. Every time my system boots, the dhcp server on the server machine gives the client's tap interface a different IP address. This is happening, because the mac address of the tap interface changes every time openvpn is restarted. So, how can I specify a persistent mac address for the tap0 interface?


Thank you.

David Bruzos
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Thu Jan 12, 2006 7:04 am    Post subject: Reply with quote

I've been thinking about this for a while and am currently thinking that we need an openvpn module for netscripts which would solve this.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
mostro
n00b
n00b


Joined: 20 May 2005
Posts: 26

PostPosted: Thu Jan 12, 2006 6:21 pm    Post subject: Reply with quote

What?

I am not sure if you are saying that there is no current way to solve this problem. Is that what you are saying?

Also, is there a way to make the net.tap0 script ignore the already created tap0 interface and just continue with the dhcpcd step. If you could do that, I openvpn could start first and then the net.tap0 interface could start without problems. This would not require a new module for openvpn. Just a simple check somewhere in the main net.lo script. Something like:
code:
if tap 0; then
do whatever
else
create tap0
do whatever
fi

This is because, openvpn would create the tap0 interface and the net.tap0 script would just have to run dhcpcd on it...
However, I am not sure that this would solve the persistent mac address problem.

David B.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Thu Jan 12, 2006 7:05 pm    Post subject: Reply with quote

If you set openvpn to start before net then you could do this in /etc/conf.d/net
Code:
modules=( "!tuntap" )


Which stops the tuntap module from activating.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum