OpenVZ Forum


Home » General » Support » Yet another OpenVPN topic (Dynamic tun device creation.)
Yet another OpenVPN topic [message #41131] Fri, 26 November 2010 14:35
rsauvat is currently offline  rsauvat
Messages: 5
Registered: May 2010
Junior Member
Hi

I have set up an OpenVPN server inside a VE using the wiki (VPN_via_the_TUN/TAP_device). After booting the VE the openvpn server works fine. I can connect to the server from a client and access to the services. (The VE is in a venet but it is fine for me as I don't want users to access other containers).

The problem is when I restart the openvpn server it fails to create a new tun device and/or it fails to delete an old tun device.

OpenVpn fails to create a tun device as it already exists in /sys/devices/virtual/net/tunX. But this doesn't exist in the HW node.

If anyone as an idea to fix this problem. Is this a misconfiguration of the container or a bug in openvz?
Any help is appreciated.

Regards.



When stopping openvpn:
Fri Nov 26 15:02:50 2010 us=190981 TCP/UDP: Closing socket
Fri Nov 26 15:02:50 2010 us=191092 /sbin/route del -net 172.20.0.0 netmask 255.255.255.0
SIOCDELRT: Operation not permitted
Fri Nov 26 15:02:50 2010 us=192030 ERROR: Linux route delete command failed: external program exited with error status: 7
Fri Nov 26 15:02:50 2010 us=192075 Closing TUN/TAP interface
Fri Nov 26 15:02:50 2010 us=192101 /sbin/ifconfig tun2 0.0.0.0
SIOCSIFADDR: Permission denied
SIOCSIFFLAGS: Permission denied
Fri Nov 26 15:02:50 2010 us=193102 Linux ip addr del failed: external program exited with error status: 255


When starting openvpn, in the VE openvpn.log I get the following error.
Note: Cannot ioctl TUNSETIFF tun: File exists (errno=17)

In the HW node in kern.log I get this :
kernel: ------------[ cut here ]------------
kernel: WARNING: at fs/sysfs/dir.c:491 sysfs_add_one+0xcc/0xe4()
kernel: Hardware name: X8STi
kernel: sysfs: cannot create duplicate filename '/devices/virtual/net/tun0'
kernel: Modules linked in: tun ipt_LOG xt_state iptable_nat nf_nat nf_conntrack_ipv4 nf_conntrack nf_defrag_ipv4 kvm_intel kvm vzethdev vznetdev simfs vzrst vzcpt vzdquota vzmon vzdev xt_tcpudp xt_length xt_hl xt_tcpmss xt_TCPMSS iptable_mangle iptable_filter xt_multiport xt_limit xt_dscp ipt_REJECT ip_tables x_tables ib_iser rdma_cm ib_cm iw_cm ib_sa ib_mad ib_core ib_addr iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi dummy bridge snd_pcm snd_timer evdev psmouse snd soundcore snd_page_alloc serio_raw i2c_i801 i2c_core ioatdma button pcspkr processor ext3 jbd mbcache dm_snapshot raid10 multipath linear thermal fan thermal_sys 8021q garp stp pata_via megaraid_sas 3w_xxxx 3w_9xxx uhci_hcd ehci_hcd usbcore nls_base qlge ixgbe dca sata_nv via686a ahci mptctl mptsas scsi_transport_sas mptspi mptscsih mptbase dm_crypt raid456 async_raid6_recov async_pq raid6_pq async_xor xor async_memcpy async_tx raid0 raid1 md_mod dm_mirror dm_region_hash dm_log sata_via ata_piix sata_sis pata_sis libata sym53c8xx megaraid aic7xxx scsi_transport_spi atl1 sky2 skge r8169 e1000e e1000 via_rhine sis900 8139too e100 mii [last unloaded: scsi_wait_scan]
kernel: Pid: 17657, comm: openvpn Tainted: G W 2.6.32-4-pve #1
kernel: Call Trace:
kernel: [<ffffffff81143e6f>] ? sysfs_add_one+0xcc/0xe4
kernel: [<ffffffff81143e6f>] ? sysfs_add_one+0xcc/0xe4
kernel: [<ffffffff8104e0bc>] ? warn_slowpath_common+0x77/0xa3
kernel: [<ffffffff8104e144>] ? warn_slowpath_fmt+0x51/0x59
kernel: [<ffffffff81143d9b>] ? sysfs_pathname+0x35/0x3d
kernel: [<ffffffff81143d9b>] ? sysfs_pathname+0x35/0x3d
kernel: [<ffffffff81143d9b>] ? sysfs_pathname+0x35/0x3d
kernel: [<ffffffff81143d9b>] ? sysfs_pathname+0x35/0x3d
kernel: [<ffffffff81143e6f>] ? sysfs_add_one+0xcc/0xe4
kernel: [<ffffffff8114441d>] ? create_dir+0x4f/0x7c
kernel: [<ffffffff8114449d>] ? sysfs_create_dir+0x53/0x68
kernel: [<ffffffff8117c013>] ? kobject_get+0x12/0x17
kernel: [<ffffffff8117c149>] ? kobject_add_internal+0xcb/0x181
kernel: [<ffffffff8117c3ab>] ? kobject_add+0x74/0x7c
kernel: [<ffffffff8117c287>] ? kobject_set_name_vargs+0x4e/0x56
kernel: [<ffffffff810e9060>] ? __kmalloc+0x15a/0x17f
kernel: [<ffffffff81313cfe>] ? mutex_lock+0xd/0x31
kernel: [<ffffffff8117c013>] ? kobject_get+0x12/0x17
kernel: [<ffffffff8120f49f>] ? get_device_parent_nodep+0x125/0x19f
kernel: [<ffffffff812104bb>] ? device_add+0xce/0x53f
kernel: [<ffffffff8125a42f>] ? sk_prot_alloc+0x5b/0x108
kernel: [<ffffffff81268a5c>] ? register_netdevice+0x218/0x30c
kernel: [<ffffffffa02f5dd4>] ? tun_chr_ioctl+0x294/0x827 [tun]
kernel: [<ffffffff810fcf06>] ? vfs_ioctl+0x21/0x6c
kernel: [<ffffffff810fd454>] ? do_vfs_ioctl+0x48d/0x4cb
kernel: [<ffffffff811824fb>] ? strncpy_from_user+0x40/0x6d
kernel: [<ffffffff810e759f>] ? virt_to_head_page+0x9/0x2a
kernel: [<ffffffff810fd4cf>] ? sys_ioctl+0x3d/0x5c
kernel: [<ffffffff81010c12>] ? system_call_fastpath+0x16/0x1b
kernel: ---[ end trace b93b77a6b200c617 ]---
kernel: kobject_add_internal failed for tun0 with -EEXIST, don't try to register things with the same name in the same directory.
kernel: Pid: 17657, comm: openvpn Tainted: G W 2.6.32-4-pve #1
kernel: Call Trace:
kernel: [<ffffffff8117c1ec>] ? kobject_add_internal+0x16e/0x181
kernel: [<ffffffff8117c3ab>] ? kobject_add+0x74/0x7c
kernel: [<ffffffff8117c287>] ? kobject_set_name_vargs+0x4e/0x56
kernel: [<ffffffff810e9060>] ? __kmalloc+0x15a/0x17f
kernel: [<ffffffff81313cfe>] ? mutex_lock+0xd/0x31
kernel: [<ffffffff8117c013>] ? kobject_get+0x12/0x17
kernel: [<ffffffff8120f49f>] ? get_device_parent_nodep+0x125/0x19f
kernel: [<ffffffff812104bb>] ? device_add+0xce/0x53f
kernel: [<ffffffff8125a42f>] ? sk_prot_alloc+0x5b/0x108
kernel: [<ffffffff81268a5c>] ? register_netdevice+0x218/0x30c
kernel: [<ffffffffa02f5dd4>] ? tun_chr_ioctl+0x294/0x827 [tun]
kernel: [<ffffffff810fcf06>] ? vfs_ioctl+0x21/0x6c
kernel: [<ffffffff810fd454>] ? do_vfs_ioctl+0x48d/0x4cb
kernel: [<ffffffff811824fb>] ? strncpy_from_user+0x40/0x6d
kernel: [<ffffffff810e759f>] ? virt_to_head_page+0x9/0x2a
kernel: [<ffffffff810fd4cf>] ? sys_ioctl+0x3d/0x5c
kernel: [<ffffffff81010c12>] ? system_call_fastpath+0x16/0x1b

Previous Topic: VEs periodically drop offline, while host remains online
Next Topic: Can not connect to OpenVZ container sometimes
Goto Forum:
  


Current Time: Thu Mar 28 16:41:12 GMT 2024

Total time taken to generate the page: 0.01728 seconds