LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-07-2006, 02:28 PM   #1
smarthouseguy
LQ Newbie
 
Registered: Jan 2006
Posts: 15

Rep: Reputation: 0
openvpn install on slackware


I've done quite a bit of searching and banging my head against the wall... Has anyone gotten open vpn setup on slackware 10.2? This is my system setup.. Slackware 10.2, kernel 2.6.15.7 running dhcpd for dhcp-server; iptables for router; asterisk for voip-pbx. I'm trying to set this up as a VPN as well so that I can access my networked windows machines at my home when I am traveling and group them with my office in another state.

I have followed the "how-to" at http://openvpn.net/howto.html using bridged-ethernet. When I try to start with bridge-start I get the following errors:

root@homepbx:/usr/local/openvpn-2.0.7/sample-scripts# ./bridge-start
Thu Sep 7 16:08:36 2006 Note: Cannot open TUN/TAP dev /dev/net/tun: No such device (errno=19)
Thu Sep 7 16:08:36 2006 Note: Attempting fallback to kernel 2.2 TUN/TAP interface
Thu Sep 7 16:08:36 2006 Cannot open TUN/TAP dev /dev/tap0: No such device or address (errno=6)
Thu Sep 7 16:08:36 2006 Exiting
./bridge-start: line 26: /usr/sbin/brctl: cannot execute binary file
./bridge-start: line 27: /usr/sbin/brctl: cannot execute binary file
./bridge-start: line 30: /usr/sbin/brctl: cannot execute binary file
SIOCSIFADDR: No such device
tap0: unknown interface: No such device
tap0: unknown interface: No such device
tap0: unknown interface: No such device
SIOCSIFADDR: No such device
br0: unknown interface: No such device
SIOCSIFNETMASK: No such device
SIOCSIFBRDADDR: No such device
br0: unknown interface: No such device

###
Here is the config file for "bridge-start":
###

#!/bin/bash

#################################
# Set up Ethernet bridge on Linux
# Requires: bridge-utils
#################################

# Define Bridge Interface
br="br0"

# Define list of TAP interfaces to be bridged,
# for example tap="tap0 tap1 tap2".
tap="tap0"

# Define physical ethernet interface to be bridged
# with TAP interface(s) above.
eth="eth0"
eth_ip="10.77.76.1"
eth_netmask="255.255.255.0"
eth_broadcast="10.77.76.255"

for t in $tap; do
openvpn --mktun --dev $t
done

brctl addbr $br
brctl addif $br $eth

for t in $tap; do
brctl addif $br $t
done

for t in $tap; do
ifconfig $t 0.0.0.0 promisc up
done

ifconfig $eth 0.0.0.0 promisc up

ifconfig $br $eth_ip netmask $eth_netmask broadcast $eth_broadcast


#####

I'm lost and really need this to work. What am I missing??
If anyone can be of some assistance I would greatly appreciate it.
Kind Regards

Last edited by smarthouseguy; 09-07-2006 at 03:13 PM.
 
Old 09-07-2006, 04:10 PM   #2
dunric
Member
 
Registered: Jul 2004
Distribution: Void Linux, former Slackware
Posts: 498

Rep: Reputation: 100Reputation: 100
It seems you miss tun/tapi device in kernel. Try to load it as a module with
Code:
modprobe tun
Hope the rest you'll be able to solve by yourself.
 
Old 09-07-2006, 05:14 PM   #3
smarthouseguy
LQ Newbie
 
Registered: Jan 2006
Posts: 15

Original Poster
Rep: Reputation: 0
didn't find it:

root@homepbx:~# modprobe tun
FATAL: Module tun not found.
root@homepbx:~# modprobe tap
FATAL: Module tap not found.
root@homepbx:~#

any idea where in the kernel that is at??

in networking I have the following options currently:
<*> Packet socket
[ ] Packet socket: mmapped IO
<*> Unix domain sockets
< > PF_KEY sockets[*] TCP/IP networking[*] IP: multicasting
[ ] IP: advanced router
[ ] IP: kernel level autoconfiguration
< > IP: tunneling
< > IP: GRE tunnels over IP
[ ] IP: multicast routing
[ ] IP: ARP daemon support (EXPERIMENTAL)
[ ] IP: TCP syncookie support (disabled per default)
< > IP: AH transformation
< > IP: ESP transformation
< > IP: IPComp transformation
< > IP: tunnel transformation
<*> INET: socket monitoring interface
[ ] TCP: advanced congestion control
IP: Virtual Server Configuration --->
< > The IPv6 protocol[*] Network packet filtering (replaces ipchains) --->
DCCP Configuration (EXPERIMENTAL) --->
SCTP Configuration (EXPERIMENTAL) --->
< > Asynchronous Transfer Mode (ATM) (EXPERIMENTAL)
< > 802.1d Ethernet Bridging
< > 802.1Q VLAN Support
< > DECnet Support
< > ANSI/IEEE 802.2 LLC type 2 Support
< > The IPX protocol
< > Appletalk protocol support
< > CCITT X.25 Packet Layer (EXPERIMENTAL)
< > LAPB Data Link Driver (EXPERIMENTAL)
[ ] Frame Diverter (EXPERIMENTAL)
< > Acorn Econet/AUN protocols (EXPERIMENTAL)
< > WAN router
QoS and/or fair queueing --->
Network testing --->

I am assuming that I need what I highlighted in red... should I do as a module or built-in.. also.. is there anything else I would need in the kernel to make this work?

Kind Regards

Last edited by smarthouseguy; 09-07-2006 at 05:26 PM.
 
Old 09-07-2006, 08:27 PM   #4
smarthouseguy
LQ Newbie
 
Registered: Jan 2006
Posts: 15

Original Poster
Rep: Reputation: 0
ok.. got the tun/tap kernel module installed.. thanks so much for the help it's gotten me furthur, but not quite there yet... so now I get this error:
Code:
root@homepbx:/usr/local/openvpn-2.0.7/sample-scripts# ./bridge-start 
Thu Sep  7 21:18:39 2006 TUN/TAP device tap0 opened
Thu Sep  7 21:18:39 2006 Persist state set to: ON
./bridge-start: line 26: /usr/sbin/brctl: cannot execute binary file
./bridge-start: line 27: /usr/sbin/brctl: cannot execute binary file
./bridge-start: line 30: /usr/sbin/brctl: cannot execute binary file
SIOCSIFADDR: No such device
br0: unknown interface: No such device
SIOCSIFNETMASK: No such device
SIOCSIFBRDADDR: No such device
br0: unknown interface: No such device
this is the bridge-start file:
Code:
#!/bin/bash

#################################
# Set up Ethernet bridge on Linux
# Requires: bridge-utils
#################################

# Define Bridge Interface
br="br0"

# Define list of TAP interfaces to be bridged,
# for example tap="tap0 tap1 tap2".
tap="tap0"

# Define physical ethernet interface to be bridged
# with TAP interface(s) above.
eth="eth0"
eth_ip="10.77.76.1"
eth_netmask="255.255.255.0"
eth_broadcast="10.77.76.255"

for t in $tap; do
    openvpn --mktun --dev $t
done

brctl addbr $br
brctl addif $br $eth

for t in $tap; do
    brctl addif $br $t
done

for t in $tap; do
    ifconfig $t 0.0.0.0 promisc up
done

ifconfig $eth 0.0.0.0 promisc up

ifconfig $br $eth_ip netmask $eth_netmask broadcast $eth_broadcast
I had installed bridge-utils without having the tun/tap kernel module, could that be the error? maybe the brctl didn't compile correctly... lemme know what ya think...

Last edited by smarthouseguy; 09-07-2006 at 08:37 PM.
 
Old 09-28-2006, 11:51 PM   #5
number22
Member
 
Registered: Sep 2006
Location: Earth
Distribution: Slackware 14.1 Slackware64-current multilib
Posts: 278
Blog Entries: 7

Rep: Reputation: Disabled
Did you fixed it?
I am trying similar setup. And I used the default kennel setup and bridge-utils, and the openvpn server(linux) talks to the client(win xp), can assign their address, however the client can not routing all its traffic throughout vpn networks, even I already tried to use push redirect-gateway local def1 within the server.conf.

and I add: route add default gw 192.168.3.1 in my vpn server, I am using 10.8.0.4 for the tap0; br0 is 192.168.3.1; eth0 was 192.168.3.1;

any help is appreciated

Last edited by number22; 09-28-2006 at 11:57 PM.
 
Old 09-29-2006, 09:49 PM   #6
theoffset
Member
 
Registered: Aug 2005
Location: Guadalajara, Jal, Mexico
Distribution: Slackware Linux
Posts: 211

Rep: Reputation: 31
Quote:
Originally Posted by smarthouseguy
ok.. got the tun/tap kernel module installed.. thanks so much for the help it's gotten me furthur, but not quite there yet... so now I get this error:
Code:
root@homepbx:/usr/local/openvpn-2.0.7/sample-scripts# ./bridge-start 
Thu Sep  7 21:18:39 2006 TUN/TAP device tap0 opened
Thu Sep  7 21:18:39 2006 Persist state set to: ON
./bridge-start: line 26: /usr/sbin/brctl: cannot execute binary file
./bridge-start: line 27: /usr/sbin/brctl: cannot execute binary file
./bridge-start: line 30: /usr/sbin/brctl: cannot execute binary file
SIOCSIFADDR: No such device
br0: unknown interface: No such device
SIOCSIFNETMASK: No such device
SIOCSIFBRDADDR: No such device
br0: unknown interface: No such device
I had installed bridge-utils without having the tun/tap kernel module, could that be the error? maybe the brctl didn't compile correctly... lemme know what ya think...
brctl in Slackware can be found under /sbin, not /usr/sbin. You can create a symlink and see if that fixes it ("ln -s /sbin/brctl /usr/sbin/brctl").

BTW, brctl is in the tcpip package.
 
Old 10-01-2006, 02:00 PM   #7
number22
Member
 
Registered: Sep 2006
Location: Earth
Distribution: Slackware 14.1 Slackware64-current multilib
Posts: 278
Blog Entries: 7

Rep: Reputation: Disabled
ok finally figure out the problem; openvpn and bridge mode

Network Background:
Internet go into a router; which has two NICs, one go out to internet which gets its ip address from ISP, the second is my own private network which has net address 192.168.3.0/255.255.255.0; very simple and straight froward setup; all my other computers shared on this sub-net with a hub/switch;

On my openvpn server which has its NIC IP address assigned 192.168.3.205 by the router (DHCP server too). this server still run other services by this address.

First; made change in bridge-start script; I want the openvpn's br0 run at different address; made change eth_ip to
192.168.3.254/255.255.255.0, so br0 will have this address.

Second; made following change in my openvpn server.conf. (for example and demonstration only)
local 192.168.3.254 1194 ----->vpn local address, your vpn client will look for it at this address which is public and put it in your client configuration file,
proto tcp-server
dev tap0
ifconfig 192.168.11.1 255.255.255.0 -----> vpn virtual address is of tap0 address.
tls-server
server-bridge 192.168.11.1 255.255.255.255.0 192.168.11.10 192.168.11.109 --------> vpn's virtual address range for vpn's client.
push "dhcp-option DNS myisp's dns"
push "redirect-gateway local def1"

Manually put back my eth0 address on this openvpn server; because you loose eth0 address by running bridge-start; or you can modify this script so it wouldn't loose its address. such as add ifconfig eth0 old_ip at the end of this file

ifconfig eth0 192.168.3.205; I can still ping back eth0 and br0 at different address, but they share this same MAC address.
openvpn server: br0 has 192.168.3.254 eth0 has 192.168.3.205.
after running openvpn server.conf
tap0 has 192.168.11.1 /255.255.255.0;

now, my client is running and can get its address from this vpn server, however it can't route its traffic out.
So I have to add these following routing table in my vpn server.

route add -net 192.168.11.0 netmask 255.255.255.0 gw 192.168.3.254 ----> br0 ip address
route add default gw 192.168.3.1 -----> my router's ip address

AND I have to add this routing table in my router:

route add -net 192.168.11.0 netmask 255.255.255.0 gw 192.168.3.254 >>> br0 ip address
my router already has default gateways.

And everything works from here, I hope this can help someone for their vpn adventure.
Next step, I will put the IP port forwarding in my router with iptables, so the vpn will run cross a firewall on my router.

My conclusion; from this experiment, the assumption about bridge will automatically add route tables is wrong, bridge(osi layer 2) will not work with router(osi layer 4) without proper routing tables. AFAIC, I am using the 2.4 kernel, and bridge will not simplify routing.

Last edited by number22; 10-04-2006 at 06:10 PM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenVPN client has not default gateway when connect to OpenVPN server sailershen Linux - Security 3 03-04-2010 02:20 AM
OpenVPN wwnexc Linux - Software 6 05-20-2006 02:34 PM
OpenVPN Voyager_MP Linux - Networking 0 07-09-2004 04:32 AM
OpenVPN dunmarie Linux - Networking 1 03-31-2004 09:28 AM
OpenVPN dunmarie Linux - Software 1 10-13-2003 12:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration