LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-17-2010, 03:11 PM   #1
fdelval
Member
 
Registered: Feb 2010
Posts: 107

Rep: Reputation: 15
bridging in linux


hello guys!

See this script:

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="192.168.8.4"
eth_netmask="255.255.255.0"
eth_broadcast="192.168.8.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
Ok, i get a tap0 device, a br0 with 192.168.8.4 ip, and a eth0 WITHOUT IP
also, the route command shows me that i dont have a gw for 192.168.8.4, it deletes the eth0 gw, but doesnt add the gw for the br0

What is that script lacking in order to work?
 
Old 07-18-2010, 01:57 PM   #2
HasC
Member
 
Registered: Oct 2009
Location: South America - Paraguay
Distribution: Debian 5 - Slackware 13.1 - Arch - Some others linuxes/*BSDs through KVM and Xen
Posts: 329

Rep: Reputation: 55
errors? messages? any output?
 
Old 07-19-2010, 05:13 AM   #3
fdelval
Member
 
Registered: Feb 2010
Posts: 107

Original Poster
Rep: Reputation: 15
a solution i found:


1) after installing openVPN, ALWAYS STOP THE SERVICE
Then ADD THIS LINE, so you can add a gateway:

gw="192.168.1.1"
route add default gw $gw $br
 
  


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
VMWare's bridging vs Window's bridging - routing is messed up when Windows bridging brenan99 General 0 05-04-2008 10:24 PM
Linux bridging problem huwnet Linux - Wireless Networking 7 09-09-2007 01:39 PM
QEMU Linux... Bridging.. And P2P lucky_dev36 General 0 03-31-2007 11:42 PM
bridging winows and linux sundar55 Linux - Software 1 01-19-2007 06:16 PM
Bridging+Bonding for Bridging+HA+Load Balancing? kartheekpn Linux - Networking 0 08-13-2006 02:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:11 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