Poradte se sitovanim (bridge)

Tomas Podermanski tpoder at cis.vutbr.cz
Wed May 14 23:04:57 CEST 2003


Dobry den,
     V postupu je drobny nedostatek. Bridge jako takove vytvareji L2 
spojeni mezi dvemi interfejsy. Na teto urovni nas IP adresa nezajima. To 
ze jeden z interfejsu muze mit prirazenou IP je zalezitost 3 vrstvy. 
Nicmene ji vubec nemusi mit prirazenou pokud chceme mit mezi dvemi 
rozhranimi pouze bridge. Ve Vasem pripade by mel byt postup nasledujici 
(pro jistou radeji po  rebootu  PC):

# ifconfig ed0 192.168.1.2 netmask 255.255.255.0
# ifconfig wi1 up
# sysctl net.link.ether.bridge_cfg=ed0,wi1
# sysctl net.link.ether.bridge=1

v teto chvili by ovladac karet mel nahlasit, ze jednotlive interfejsy byly prepnuty do promiskuitniho rezimu. Pokud se tak nestalo je nutne rucne spoustet ifconfig s parametrem promisc (ifconfig wi1 promisc up) - pozor funguje az od verze 4.7. V ifconfigu je pak v ramci flags rozvnez vyznacen tento rezim. 

Od teto chvile by jiz vse melo fungovat. Doporucuju ovsem pro bridge pouzivat BSD >= 4.7. V drivejsich verzich dochazelo mnohdy k podivnemu chovani a kod byl dokonce vybiravy i na nektere typy karet (nevim jak tomu bude v pripade wi - nikdy jsem nemel moznost vyzkouset). 

Jeste jedna poznamka. Prikaz sysctl net.link.ether.bridge=1 se musi provest az po inicializaci ovladacu, takze jej nemuzete umistit do /etc/sysctl.conf. V tomto pripade bridge rovnez nefunguji a ani system to nijak nesdeli. 


T. Podermanski 


PS: Pokud budou bridge s wi ovladacem fungovat dejte pak prosim vedet. dik. 


milan.cizek at up.mpsv.cz wrote:

>Ahoj,
>snazim se na svem domacim FreeBSD rozjet bridge a nedari se. Mozna je
>problem v tom, ze vlastne ani 100% nevim, jestli je to to prave, a jak to po
>teoreticke strance funguje. Mam nasledujici situaci:
>
>WiFi AccessPoint (192.168.1.251)<>FreeBSD[wi1<>ed0 (192.168.1.2)]<>PC s Win
>(192.168.1.10)
>
>wi1 je Wireless Z-Com karta, ed0 je bezne ethernet device nejaky Realtek.
>Mym cilem je videt z WinPC AP (a dalsi klienty za) stejne tak i opacne. Je
>bridge to co potrebuju?
>
>Podle ziskanych informaci by se pak obe karty meli tvarit jako jednina, tj.
>transparentne s jednou IP (?). K wi1 se mi ale IP priradit nepodari, stejne
>tak ji nepriradi ani system (coz by asi mel), IP z uplně jineho rozsahu
>priradit lze. Jak poznam, ze mi to uspesne funguje (ping je jasnej, ale
>jinak? netstat?).
>
>
>router# ifconfig ed0
>ed0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>        inet 192.168.1.2 netmask 0xffffff00 broadcast 192.168.1.255
>        inet6 fe80::250:baff:fecd:7358%ed0 prefixlen 64 scopeid 0x4
>        ether 00:50:ba:cd:73:58
>router# ifconfig wi1
>wi1: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>        ether 00:60:b3:6b:0f:02
>        media: IEEE 802.11 Wireless Ethernet DS/11Mbps
>        status: associated
>        ssid test 1:chvalsiny.net
>        stationname "FreeBSD WaveLAN/IEEE node"
>        channel 4 authmode OPEN powersavemode OFF powersavesleep 100
>        wepmode OFF weptxkey 1
>
>router# ifconfig wi1 inet 10.0.0.1 netmask 255.255.255.0
>router# ifconfig wi1 inet 192.0.0.1 netmask 255.255.255.0
>router# ifconfig wi1 inet 192.168.0.1 netmask 255.255.255.0
>router# ifconfig wi1 inet 192.168.1.1 netmask 255.255.255.0
>ifconfig: ioctl (SIOCAIFADDR): File exists
>router# ifconfig wi1 inet 192.168.1.13 netmask 255.255.255.0
>ifconfig: ioctl (SIOCAIFADDR): File exists
>router# ifconfig wi1
>wi1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>        inet6 fe80::260:b3ff:fe6b:f02%wi1 prefixlen 64 scopeid 0x2
>        ether 00:60:b3:6b:0f:02
>        media: IEEE 802.11 Wireless Ethernet autoselect (DS/2Mbps)
>        status: associated
>        ssid test 1:""
>        stationname "FreeBSD WaveLAN/IEEE node"
>        channel 4 authmode OPEN powersavemode OFF powersavesleep 100
>        wepmode OFF weptxkey 1
>router# ifconfig ed0
>ed0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>        inet 192.168.1.2 netmask 0xffffff00 broadcast 192.168.1.255
>        inet6 fe80::250:baff:fecd:7358%ed0 prefixlen 64 scopeid 0x4
>        ether 00:50:ba:cd:73:58
>
>router# kldstat
>Id Refs Address    Size     Name
> 1    2 0xc0100000 52679c   kernel
> 2    1 0xc1227000 6000     bridge.ko
>
>router# sysctl net.link.ether.bridge=1
>net.link.ether.bridge: 0 -> 1
>router# sysctl net.link.ether.bridge_cfg="ed0 wi1"
>net.link.ether.bridge_cfg:  -> ed0 wi1
>router# sysctl net.inet.ip.forwarding=1
>net.inet.ip.forwarding: 0 -> 1
>
>Tady je to stale stejne - karta nema potrebnou IP.
>
>Milan
>  
>





More information about the Users-l mailing list