Results 1 to 9 of 9

Thread: creating a network bridge on ubuntu

  1. #1
    Join Date
    May 2010
    Location
    New Zealand
    Beans
    94
    Distro
    Ubuntu 12.04 Precise Pangolin

    creating a network bridge on ubuntu

    hi
    can anybody help me set up a network bridge between my Internet/network and another computer (both wired), or atleast point me toward an up-to-date guide(all the guides i have found are 5 years old).
    thanks

  2. #2
    Join Date
    Jun 2010
    Beans
    3

    Re: creating a network bridge on ubuntu

    hi

    Code:
    sudo apt-get update
    sudo apt-get install bridge-utils

    and write

    Code:
    ifconfig <interface 1> 0.0.0.0 <<BR>>
    ifconfig <interface 2> 0.0.0.0 <<BR>>
    brctl addbr <bridge name> <<BR>>
    brctl addif <bridge name> <interface 1> <<BR>>
    brctl addif <bridge name> <interface 2> <<BR>>
    ifconfig <bridge name> up



    thanx

  3. #3
    Join Date
    Jan 2006
    Location
    U.S.A.
    Beans
    971
    Distro
    Ubuntu 15.10 Wily Werewolf

    Re: creating a network bridge on ubuntu

    I hope he/she understands that you didn't mean he/she should type <<BR>> at the end of those commands.
    Favorite man page quote: "The backreference \n, where n is a single digit, matches the substring previously matched by the nth parenthesized subexpression of the regular expression." [excerpt from grep(1)]

  4. #4
    Join Date
    May 2010
    Location
    New Zealand
    Beans
    94
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: creating a network bridge on ubuntu

    although this does work, there is a few problems.
    1) when I restart the bridge resets.
    2) don't know whether this is possible to fix, but I would like to allow this computer to access the network as well as being a bridge.

  5. #5
    Join Date
    Jun 2007
    Beans
    52
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: creating a network bridge on ubuntu

    Sundays211,
    I'm working on the same problem.. I added
    Code:
    iface br0 inet dhcp
    bridge_ports all
    to /etc/network/interfaces (and DON'T comment out any line with "lo"). Then
    Code:
    sudo ifup br0
    It created a bridge, but ping time decreased, so I
    Code:
    sudo ethtool -K br0 sg off tx off tso off
    which helped.. But, I had same problem as you, after restart bridge went away. I put "/sbin/ifup br0" in /etc/rc.local. .

    To solve the (non)-issue of bridge_utils kicking the error "postconf: fatal: open /etc/postfix/main.cf: No such file or directory" I
    Code:
    sudo ln -sf /usr/share/postfix/main.cf.dist /etc/postfix/main.cf
    But this should not be required..

    Also, if you want your bridge to have a static ip, add this (instead of above) to "/etc/network/interfaces": (replace my IP's with yours)
    Code:
    iface br0 inet static
    	address 192.168.9.XXX
    	netmask 255.255.255.0
    	gateway 192.168.9.XXX
    	bridge_ports all
    Last edited by ub-newbie; June 12th, 2010 at 03:18 PM. Reason: Clarity, fix bad advice, add static ip

  6. #6
    Join Date
    Jan 2006
    Location
    U.S.A.
    Beans
    971
    Distro
    Ubuntu 15.10 Wily Werewolf

    Re: creating a network bridge on ubuntu

    To make it persist after restart, you need to add it to your distro's networking scripts. I don't use Ubuntu, so I don't know how you would do that. In a general sense, it's just another startup script.

    As to the network latency, forwarding delay might have something to do with that (although I'm not sure). A bridge interface has something called a "forwarding delay", which you can set to 0 like so:
    Code:
    brctl setfd br0 0
    However, the default forwarding delay is there for a reason, so you should study what this is and how it works before making any changes. I emphasize this because I don't really know what it is or how it works, and I don't want to be blamed for your misfortunes. (I do, however, use it on a bridge that I have, although there is nothing connected to it but virtualized guest operating system instances on the same physical machine as the bridge.)
    Favorite man page quote: "The backreference \n, where n is a single digit, matches the substring previously matched by the nth parenthesized subexpression of the regular expression." [excerpt from grep(1)]

  7. #7
    Join Date
    Jun 2007
    Beans
    52
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: creating a network bridge on ubuntu

    To have it persistent with Ubuntu 10.4, place
    Code:
    /sbin/ifup br0
    in /etc/rc.local (and make sure it is executable).

  8. #8
    Join Date
    Mar 2010
    Location
    South Africa
    Beans
    356
    Distro
    Ubuntu

    Re: creating a network bridge on ubuntu

    Quote Originally Posted by sundays211 View Post
    although this does work, there is a few problems.
    2) don't know whether this is possible to fix, but I would like to allow this computer to access the network as well as being a bridge.
    has anybody got an answer to this ?
    Registered Linux user: #543082
    Registered Ubuntu user: #34219
    http://dvisagie.com/


  9. #9
    Join Date
    Jun 2007
    Beans
    52
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: creating a network bridge on ubuntu

    snip3r8
    I can connect to the Internet on the computer & pass traffic through the bridge (to the webcam) at the same time.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •