View previous topic :: View next topic |
Author |
Message |
akbarstatx n00b
Joined: 14 Oct 2002 Posts: 67 Location: Minneapolis, MN
|
Posted: Fri Nov 25, 2005 9:08 pm Post subject: ethernet bridge ip address |
|
|
Hi all, I am testing out ethernet bridging and I have a question about assinging the bridge interface an ip address. I have three nic in the box, two are part of the bridge (eth1 and eth2) and one (eth0) is used as a maintaince port. I have the maint port eth0 assigned an IP address via dhcp on 10.0.0.1/24 and this works fine. I have a static address config'd for the br0 interface as 10.0.0.15, this is an un-used ip address on the network. When eth0 is not attached I am unable to reach the br0 via the static IP address and the bridge still works. When I have eth0 connected I am able to connect to the bridge box via ssh or what ever else just fine and the bridge still works. I have configured the bridge using with the follwing in /etc/conf.d/net:
Code: |
# Bridging (802.1d)
# For bridging support emerge net-misc/bridge-utils
# To add ports to bridge br0
bridge_br0="eth1 eth2"
# You need to configure the ports to null values so dhcp does not get started
config_eth1=( "null" )
config_eth2=( "null" )
# Finally give the bridge an address - dhcp or a static IP
#config_br0=( "dhcp" )
config_br0=( "10.0.0.15/24" )
# If any of the ports require extra configuration - for example wireless or
# ppp devices - we need to write a depend function for the bridge so they get
# configured correctly.
# This is exactly the same as a depend() function in our init scripts
#depend_br0() {
# need net.eth0 net.eth1
#}
# NOTE: This creates an interface called br0 - you can give the interface
# any name you like
# Below is an example of configuring the bridge
# Consult "man brctl" for more details
brctl_br0=( "setfd 0" "sethello 0" "stp off" )
|
My questions are: Why is the br0 ip not availiable while the eth0 is disconnected? Do I need to add a default gateway explicitly to the br0 to make the IP availiable?
Any educational comments about briding and ip address assignment will be greatly appreaciated. |
|
Back to top |
|
|
1U Guru
Joined: 21 Jul 2005 Posts: 319
|
Posted: Fri Dec 02, 2005 7:20 am Post subject: |
|
|
I'm not an expert on bridges but I run them here and there without any problems. I'm assuming you already have bridge-utils installed and bridging enabled in your kernel. Here's an example of my config file:
Code: | config_eth0=( "dhcp" )
brctl_br0=( "setfd 0" "sethello 0" "stp off" )
bridge_br0="eth1 eth2"
config_eth1=( "null" )
config_eth2=( "null" )
config_br0=( "192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255" ) |
Hmm, I can't seem to find anything wrong with your config. It looks nearly identical to mine but the only thing I could recommend is perhaps specifying more options in config_br0 such as in my example. It's worth a try, I've had some pretty mysterious bridging problems before but they went away after a few kernel upgrades so perhaps that could also be reponsible. Perhaps the order they are in also makes a difference on the config file? Though I highly doubt it. |
|
Back to top |
|
|
akbarstatx n00b
Joined: 14 Oct 2002 Posts: 67 Location: Minneapolis, MN
|
Posted: Wed Dec 14, 2005 6:35 pm Post subject: |
|
|
Well everything is working now, must have been the reboot. Thanks for your help |
|
Back to top |
|
|
|