LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-14-2010, 09:01 AM   #1
Exise
LQ Newbie
 
Registered: Jan 2010
Location: Netherlands
Distribution: Ubuntu (server) & RPi
Posts: 5

Rep: Reputation: 0
Creating a virtual ethernet adapter


I am trying to setup a VPN using OpenVPN to allow a secure connection between my smartphone and my LAN. I have been reading an OpenVPN book and some tutorials on how to setup the server side, but I'm stuck at how to create a virtual device.

The OpenVPN book says when installing OpenVPN the installer (or aptitude to be more precise) should ask me if it should create a TAP/TUN device. The thing is, it doesn't ask me anything at all. It just installs, that's it.

Most tutorials simply tell me to create a new device in the network/interfaces file.

Where is the difference? What should I do now? I like having options, that is one reason I like Linux, but this does confuse me.

My second question is about the IP range of the virtual adapter. Should it be in the same range as my LAN, or should I use something entirely different?
 
Old 04-15-2010, 02:51 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
I'm answering this because nobody else has rather than because I'm knowledgeable on the subject. What I do know comes from configuring bridge/tap/tun for VirtualBox, when it still needed them. Here's the interfaces file. I may be a helpful starting point for you.
Code:
# eth0 is the physical interface.
# Bridging software will configure eth0 when it is added as a port to br0 (below)
# This minimal configuration avoids message "Ignoring unknown interface eth0=eth0"
auto eth0
iface eth0 inet manual
up ifconfig $IFACE 0.0.0.0 up
down ifconfig $IFACE down

# tap0 is a tap into the bridge defined below
# * tap0 is for use by VirtualBox
# * Guest OS will configure, hence "manual"
# * VirtualBox will be run by user c, hence user c
# * "ifconfig" is part of ifupdown package 
# * "tunctl_user" is part of tunctl package
auto tap0 
iface tap0 inet manual 
up ifconfig $IFACE 0.0.0.0 up 
down ifconfig $IFACE down 
tunctl_user c 

# 5apr9 Added tap1, same as tap0, for second VirtualBox VM
auto tap1 
iface tap0 inet manual 
up ifconfig $IFACE 0.0.0.0 up 
down ifconfig $IFACE down 
tunctl_user c 

# br0 is a bridge connecting physical interface eth0 to OS, tap0 and tap1
# * Stanzas for br0 ports must appear before the br0 stanza
# * Static configuration 
# * No need for spanning tree protocol (stp) because no other bridges on network
# 5apr9 Added tap1
iface br0 inet static
address 192.168.0.11 
network 192.168.0.0
netmask 255.255.255.0 
broadcast 192.168.0.255
gateway 192.168.0.253
bridge_ports eth0 tap0 tap1
bridge_maxwait 0 
bridge_stp off
 
  


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
Virtual ethernet adapter cold Linux - Networking 4 04-15-2010 02:17 AM
lm-sensors acpitz-virtual-0 Adapter: Virtual device temp1: <- What is it? Maintech Linux - Hardware 9 08-24-2009 02:35 PM
Virtual Ethernet Adapter for Linux? tfm1 Linux - Software 1 01-24-2007 12:45 PM
ethernet card SiS 900-Based PCI Fast Ethernet Adapter Not Detected pathan_azhar Linux - Networking 0 08-13-2006 04:15 AM
creating virtual (aliased) ethernet cards otisthegbs Linux - Networking 3 05-24-2004 03:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:10 AM.

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