Friday, September 3, 2010

Windows Bridge vs Linux Bridge

Alright Folks,


Here is another reminder why we should stick with *nix based operational systems.


You may need to use your host's interfaces as Bridge connections in some special situation like i do. I had to bridge a USB network interface and an Ethernet interface in my Windows 7 OS. Well, you may this is a piece of cake operation for Windows. You just select network connection icons and left click, Bridge Connections and you're done. Frankly, yeah it worked that once but after a while it stop working as Bridge for uncertain reason. I dig some netsh commands to fix it, i had failed, succeed. But he real thing is here, there is something fishy about Windows 7 TCP stack when you compare with XP's So i decide to try with more reliable and less complicated XP. Results may vary both fail and success but no logical explanation of why failed or succeeded. 


That reminds me how easy to create bridge connections in *nix operational systems. I wish i had that privilege to use one however the USB interface doesn't have Linux drivers or source codes in any format so i had to go with Windows. What if i could use a Linux system how can i set that bridge connection, here is the answer;


Let say we create the USB interface and named it as eth1 and our native ethernet interface named aas eth0. First you need to make  them up, to do that, 



ifconfig eth0 0.0.0.0 up
ifconfig eth1 0.0.0.0 up
Then you need to put them in same bridge connection with brctl
Create a bridge-group interface:
brctl addbr br0
Add each interface to the bridge-group br0
brctl addif br0 eth0
brctl addif br0 eth1
You can assign an IP address to this Bridge connection if you like,
Assigned an ip address to the bridge-group br0 for management
ifconfig br0 192.168.1.2 netmask 255.255.255.0

And also maybe a default route so you can manage from another network
route add default gw 192.168.1.1

That's it ;)

Hey, btw that reminds me how poor *nux OS driver support of USB manufacturers in wireless products.

I hope you find it useful.

Cheers

Typhoon Master 

2 comments: