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 12-08-2003, 02:03 PM   #1
filipanu
LQ Newbie
 
Registered: Sep 2003
Distribution: Red Hat 9.0 (Shrike)
Posts: 8

Rep: Reputation: 0
bridge enabled, no internet


hello!
i have a redhat 9 box with two ethers. The gateway is on eth0 segment. The problem is that when i enable bridging, i cannot ping in internet. I think it is a route problem. Please help!

DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.0.2
NETMASK=255.255.255.0
USERCTL=no
PEERDNS=no
GATEWAY=192.168.0.1
TYPE=Ethernet
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
HWADDR=00:50:fc:e4:21:c5

and

USERCTL=no
PEERDNS=no
TYPE=Ethernet
DEVICE=eth1
HWADDR=00:50:fc:e4:33:10
BOOTPROTO=none
NETMASK=255.255.255.0
ONBOOT=yes
IPADDR=192.168.0.30
NETWORK=192.168.0.0
BROADCAST=192.168.0.255


i enable the bridge using the following commands

brctl addbr br0
brctl addif br0 eth0
brctl addif br0 eth1
ifconfig eth0 0.0.0.0
ifconfig eth1 0.0.0.0
ifconfig br0 192.168.0.31
 
Old 12-08-2003, 05:56 PM   #2
GraemeK
Member
 
Registered: Aug 2003
Location: Essex, UK
Distribution: Windoze 2000, Fedora Core 3
Posts: 325

Rep: Reputation: 30
when you do a brctl show what you see?

i've played with bridging a bit and havent had a problem. why are you assigning ips to eth1?

anyways.....everything looks fine to me apart from the fact that your assigning ips to the nics then canceling them with the ifconfig ethX 0.0.0.0

do a brctl show - what you see?

do a ifconfig what you see?

G
 
Old 12-09-2003, 09:19 AM   #3
filipanu
LQ Newbie
 
Registered: Sep 2003
Distribution: Red Hat 9.0 (Shrike)
Posts: 8

Original Poster
Rep: Reputation: 0
brctl show
bridge name bridge id STP enabled interfaces
br0 8000.0050fce421c5 yes eth0
eth1

ifconfig

eth0 Link encap:Ethernet HWaddr 00:50:FC:E4:21:C5
inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:510 errors:0 dropped:0 overruns:0 frame:0
TX packets:562 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:157489 (153.7 Kb) TX bytes:108562 (106.0 Kb)
Interrupt:11 Base address:0x7000

eth1 Link encap:Ethernet HWaddr 00:50:FC:E4:33:10
inet addr:192.168.0.30 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 b) TX bytes:240 (240.0 b)
Interrupt:5 Base address:0x9000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1760 errors:0 dropped:0 overruns:0 frame:0
TX packets:1760 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:119698 (116.8 Kb) TX bytes:119698 (116.8 Kb)

route is a little bit odd
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 * 255.255.255.0 U 0 0 0 eth1
192.168.0.0 * 255.255.255.0 U 0 0 0 eth1
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default gate 0.0.0.0 UG 0 0 0 eth0

gate is 192.168.0.1
an entry shows twice but i cannot delete it
route del 192.168.0.0
SIOCDELRT: No such process

as soon as i delete the bridge, the internet is accesible.

Last edited by filipanu; 12-09-2003 at 09:24 AM.
 
Old 12-09-2003, 12:46 PM   #4
filipanu
LQ Newbie
 
Registered: Sep 2003
Distribution: Red Hat 9.0 (Shrike)
Posts: 8

Original Poster
Rep: Reputation: 0
Well, i figured it out. This was the correct init sequence for the bridge
cd /sbin
brctl addbr br0
brctl addif br0 eth0
brctl addif br0 eth1
ifconfig eth0 0.0.0.0 up
ifconfig eth1 0.0.0.0 up
ifconfig br0 192.168.0.2 up
echo "1" > /proc/sys/net/ipv4/ip_forward
route add default gw 192.168.0.1
 
Old 12-11-2003, 11:22 AM   #5
GraemeK
Member
 
Registered: Aug 2003
Location: Essex, UK
Distribution: Windoze 2000, Fedora Core 3
Posts: 325

Rep: Reputation: 30
coooooooool!
 
Old 01-04-2005, 03:18 AM   #6
sanket1
LQ Newbie
 
Registered: Jan 2005
Posts: 1

Rep: Reputation: 0
I have a similar problem. Whenever this line "ifconfig $ETH_PRIV 0.0.0.0 promisc up" is executed, the ip address of ETH_PRIV is changed. However after some time it reassigns its original IP address. I guess this happens after this line "ifconfig $BRIDGE_DEV $ETH_PRIV_IP netmask "

I have a Redhat Enterprise Machine with 2 interfaces.

DEVICE=eth1
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.11.77
NETMASK=255.255.255.0
HWADDR=00:E0:81:29:FD:17


i SETUP my bridge by running the following script

#startbridge: script which the adds bridging device & configures it accordingly

BRIDGE_DEV=br0
ETH_PRIV=eth1
ETH_PRIV_IP=192.168.13.192

brctl addbr $BRIDGE_DEV
RETVAL=$?
if [ $RETVAL != 0 ] ; then
echo "Add Brdige failed"
exit 1
fi

brctl addif $BRIDGE_DEV bb0
RETVAL=$?
if [ $RETVAL != 0 ] ; then
echo "Adding bb0 to bridge $BRIDGE_DEV failed"
exit 1
fi

brctl addif $BRIDGE_DEV $ETH_PRIV
RETVAL=$?
if [ $RETVAL != 0 ] ; then
echo "Adding $ETH_PRIV-(private network interface) to bridge $BRIDGE_DEV failed"
exit 1
fi

#Set the IP address of ETH_PRIV
ifconfig $ETH_PRIV 0.0.0.0 promisc up
RETVAL=$?
if [ $RETVAL != 0 ] ; then
echo "Setting ETH_PRIV to promisc mode failed"
exit 1
fi

ifconfig $BRIDGE_DEV $ETH_PRIV_IP netmask $ETH_PRIV_NETMASK up
RETVAL=$?
if [ $RETVAL != 0 ] ; then
echo "Adding IP Address to Bridge Failed"
exit 1
fi

brctl show
./ifconfig

#Amount of time spends listening for topology change information after that interface is
#activated for bridging and before forwarding actually begins
brctl setfd $BRIDGE_DEV 5
RETVAL=$?
if [ $RETVAL != 0 ] ; then
echo "Setting bridge forward delay failed"
exit 1
fi

# Allow incoming BBVPN packets
.......
....
...

ifconfig $ETH_PRIV 0.0.0.0 promisc up
 
  


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
internet connection sharing through bridge positiveinflux Linux - Networking 6 04-03-2007 11:16 PM
Internet Connection Sharing Problem / says always enabled deadlove75 Mandriva 2 10-18-2005 06:16 PM
can't see WAN/internet through wireless bridge plastic_gnome Linux - Wireless Networking 2 05-21-2005 10:32 AM
Internet Sharing & nic bridge? darchon Linux - Networking 21 03-29-2003 03:00 AM
Internet, routing and bridge Gorchi Linux - Networking 3 03-01-2003 09:29 PM

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

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