Openvpn is unable to assign dhcp from remote LAN in up/down scripts

Bug #1193614 reported by sefs
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openvpn (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Hi,

When setting up Openvpn in bridged mode, openvpn is unable to configure the tap interface on the client for dhcp from the remote LAN.

Server:
-----------------------------------------------------------------------------
...
server-bridge
push "route-gateway 192.168.1.1"
push "redirect-gateway def1 bypass-dhcp"
client-to-client
...

Client:
-----------------------------------------------------------------------------
...

up /etc/openvpn/dhcp.sh
down /etc/openvpn/dhcp.sh
...

dhcp.sh:
-----------------------------------------------------------------------------
#!/bin/bash
#
[ -x /sbin/dhclient ] || exit 0

case $script_type in

up)
 dhclient -v "${dev}"
 ;;
down)
 dhclient -r "${dev}"
 ;;
esac

dhclient attempts to configure tap interface on client but eventually times out.

Errors:
-----------------------------------------------------------------------------
...
Sat Jun 22 07:40:02 2013 TUN/TAP device tap0 opened
Sat Jun 22 07:40:02 2013 TUN/TAP TX queue length set to 100
Sat Jun 22 07:40:02 2013 /sbin/route add -net xxx.xxx.xxx.xxx netmask 255.255.255.255 gw 192.168.2.1
Sat Jun 22 07:40:02 2013 /sbin/route add -net 0.0.0.0 netmask 128.0.0.0 gw 192.168.1.1
SIOCADDRT: No such process
Sat Jun 22 07:40:02 2013 ERROR: Linux route add command failed: external program exited with error status: 7
Sat Jun 22 07:40:02 2013 /sbin/route add -net 128.0.0.0 netmask 128.0.0.0 gw 192.168.1.1
SIOCADDRT: No such process
Sat Jun 22 07:40:02 2013 ERROR: Linux route add command failed: external program exited with error status: 7
Sat Jun 22 07:40:02 2013 Initialization Sequence Completed

and on shutting down connection:
Errors:
-----------------------------------------------------------------------------
Sat Jun 22 07:42:28 2013 event_wait : Interrupted system call (code=4)
Sat Jun 22 07:42:28 2013 SIGTERM received, sending exit notification to peer
Sat Jun 22 07:42:31 2013 TCP/UDP: Closing socket
Sat Jun 22 07:42:31 2013 /sbin/route del -net xxx.xxx.xxx.xxx netmask 255.255.255.255
Sat Jun 22 07:42:31 2013 /sbin/route del -net 0.0.0.0 netmask 128.0.0.0
SIOCDELRT: No such process
Sat Jun 22 07:42:31 2013 ERROR: Linux route delete command failed: external program exited with error status: 7
Sat Jun 22 07:42:31 2013 /sbin/route del -net 128.0.0.0 netmask 128.0.0.0
SIOCDELRT: No such process
Sat Jun 22 07:42:31 2013 ERROR: Linux route delete command failed: external program exited with error status: 7
Sat Jun 22 07:42:31 2013 Closing TUN/TAP interface
Sat Jun 22 07:42:31 2013 SIGTERM[soft,exit-with-notification] received, process exiting

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1193614/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
sefs (sefsinc)
affects: ubuntu → openvpn (Ubuntu)
sefs (sefsinc)
description: updated
Revision history for this message
sefs (sefsinc) wrote :

Although this seems to be automatic in MS Windows, it does not appear the same for linux.

Possible Workaround: http://ubuntuforums.org/showthread.php?t=2156126

Revision history for this message
Webanck (antoine-webanck) wrote :

I have the same problem with OpenVPN 2.3.8.
The status of the tap interface when calling the up script seems to b seems to be different from it's status after the initialization of the connection.

Changed in openvpn (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.