Home » General » Support » openvpn and tap/bridging with a "dummy" network adapter?
|
|
|
Re: openvpn and tap/bridging with a "dummy" network adapter? [message #1791 is a reply to message #1787] |
Fri, 24 February 2006 09:02 |
dev
Messages: 1693 Registered: September 2005 Location: Moscow
|
Senior Member |
|
|
from what I see from sources:
case BRCTL_ADD_BRIDGE:
case BRCTL_DEL_BRIDGE:
{
char buf[IFNAMSIZ];
if (!capable(CAP_NET_ADMIN))
return -EPERM;
if (copy_from_user(buf, (void __user *)args[1], IFNAMSIZ))
return -EFAULT;
buf[IFNAMSIZ-1] = 0;
if (args[0] == BRCTL_ADD_BRIDGE)
return br_add_bridge(buf);
return br_del_bridge(buf);
}
CAP_NET_ADMIN (net_admin) should be enough...
you can add all the capabilities to your VPS at first, we can resolve this later. But `strace -f brctl addbr br0` would help to do it now ))
We don't have description of capabilities in the man page, since this is a standart security model of Linux kernel...
[Updated on: Fri, 24 February 2006 09:02] Report message to a moderator
|
|
|
Re: openvpn and tap/bridging with a "dummy" network adapter? [message #1796 is a reply to message #1791] |
Fri, 24 February 2006 19:38 |
snowdeal
Messages: 22 Registered: February 2006
|
Junior Member |
|
|
from the vps config file, i can verify that net_admin is set [1]. results from strace [2].
[1] CAPABILITY="NET_ADMIN:on"
[2]
strace -f /usr/sbin/brctl addbr br0
execve("/usr/sbin/brctl", ["/usr/sbin/brctl", "addbr", "br0"], [/* 19 vars */]) = 0
uname({sys="Linux", node="foo.bar.com", ...}) = 0
brk(0) = 0x804e000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=20708, ...}) = 0
old_mmap(NULL, 20708, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40017000
close(3) = 0
open("/usr/lib/libsysfs.so.1", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\234#\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=38652, ...}) = 0
old_mmap(NULL, 37484, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x4001d000
old_mmap(0x40026000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9000) = 0x40026000
close(3) = 0
open("/lib/tls/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20O\1\000"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1451366, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40027000
old_mmap(NULL, 1219772, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x40028000
old_mmap(0x4014c000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x124000) = 0x4014c000
old_mmap(0x40150000, 7356, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40150000
close(3) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40152000
mprotect(0x4014c000, 4096, PROT_READ) = 0
mprotect(0x40015000, 4096, PROT_READ) = 0
set_thread_area({entry_number:-1 -> 6, base_addr:0x401526c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
munmap(0x40017000, 20708) = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
brk(0) = 0x804e000
brk(0x806f000) = 0x806f000
open("/proc/mounts", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40017000
read(4, "simfs / simfs rw 0 0\nproc /proc "..., 1024) = 85
read(4, "", 1024) = 0
close(4) = 0
munmap(0x40017000, 4096) = 0
ioctl(3, 0x89a0, 0xbffffc6f) = -1 EPERM (Operation not permitted)
ioctl(3, SIOCSIFBR, 0xbffff0e0) = -1 EPERM (Operation not permitted)
write(2, "add bridge failed: Operation not"..., 43add bridge failed: Operation not permitted
) = 43
exit_group(1) = ?
Process 3987 detached
[Updated on: Fri, 24 February 2006 19:39] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
Re: openvpn and tap/bridging with a "dummy" network adapter? [message #48855 is a reply to message #1993] |
Fri, 21 December 2012 03:27 |
bensig
Messages: 1 Registered: December 2012
|
Junior Member |
|
|
Trying to do the same thing as the above user... adding a dummy device to VPS and get bridge going on Openvpn running on centos 5:
[root@system /]# brctl addbr br0
add bridge failed: Inappropriate ioctl for device
[root@us /]# strace -f brctl addbr br0
execve("/usr/sbin/brctl", ["brctl", "addbr", "br0"], [/* 17 vars */]) = 0
brk(0) = 0x8ff000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f7d59fba000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f7d59fb9000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=21438, ...}) = 0
mmap(NULL, 21438, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f7d59fb3000
close(3) = 0
open("/usr/lib64/libsysfs.so.2", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320&\0\0\0\0\0\0 "..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=43952, ...}) = 0
mmap(NULL, 2139280, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f7d59b94000
mprotect(0x7f7d59b9e000, 2097152, PROT_NONE) = 0
mmap(0x7f7d59d9e000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xa000) = 0x7f7d59d9e000
close(3) = 0
open("/lib64/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220\332\1\0\0\0\0\0 "..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1712648, ...}) = 0
mmap(NULL, 3498328, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f7d5983d000
mprotect(0x7f7d5998b000, 2093056, PROT_NONE) = 0
mmap(0x7f7d59b8a000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14d000) = 0x7f7d59b8a000
mmap(0x7f7d59b8f000, 16728, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f7d59b8f000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f7d59fb2000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f7d59fb1000
arch_prctl(ARCH_SET_FS, 0x7f7d59fb16e0) = 0
mprotect(0x7f7d59b8a000, 16384, PROT_READ) = 0
mprotect(0x7f7d59fbb000, 4096, PROT_READ) = 0
munmap(0x7f7d59fb3000, 21438) = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
lstat("/sys/class/net", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
brk(0) = 0x8ff000
brk(0x920000) = 0x920000
ioctl(3, 0x89a0, 0x7fffe7952ca9) = -1 ENOTTY (Inappropriate ioctl for device)
ioctl(3, SIOCSIFBR, 0x7fffe7951f60) = -1 ENOTTY (Inappropriate ioctl for device)
write(2, "add bridge failed: Inappropriate"..., 50add bridge failed: Inappropriate ioctl for device
) = 50
exit_group(1) = ?
not sure why it's failing here... any help?
|
|
|
Goto Forum:
Current Time: Wed Nov 06 06:11:54 GMT 2024
Total time taken to generate the page: 0.03410 seconds
|