Portál AbcLinuxu, 15. července 2025 02:03
RC_NEED_br0="net.eth0" bridge_br0=("eth0 wlan0") config_br0=( "192.168.1.99 netmask 255.255.255.0" ) routes_br0=( "default gw 192.168.1.1" )Po tomto nastavení internet ze strojů, připojujících se k tomuto přes wifi, funguje. Problém ale je, že se nikam ven nepingnu z tohoto stroje samotného... Vycházel jsem z návodu Bridging_Network_Interfaces na Gentoo Wiki, podle kterého
To be able to access internet on current machine
řeší nastavení RC_NEED. To ale jedině způsobí závislost init scriptů (při shození eth0 se shodí i br0), ale problém samotný to neřeší...
Budu rád za jakékoliv tipy, co dělám špatně. Díky!
Řešení dotazu:
ompc ~ # route Směrovací tabulka v jádru pro IP Adresát Brána Maska Přízn Metrik Odkaz Užt Rozhraní default router.localnet 0.0.0.0 UG 0 0 0 eth0 default router.localnet 0.0.0.0 UG 1000 0 0 br0 loopback * 255.0.0.0 U 0 0 0 lo 192.168.1.0 * 255.255.255.0 U 0 0 0 eth0 192.168.1.0 * 255.255.255.0 U 0 0 0 br0 ompc ~ # brctl show bridge name bridge id STP enabled interfaces br0 8000.000e2e487d27 no eth0 wlan0
eth0
a mít jí jen na br0
?
To samé tu default routu jen jednu na br0
?
Pokud mam bridge s tap0 a eth0, tak mam IP na br0 a dostanu se skrze eth0 do sítě a ze sítě na tap0 do virtuálu.
Tazatali původního dotazu, co Ti vypíše "ip route get NEJAKA_VEREJNA_IP"? Měl bys tam mít interfejs br0.
Ok, vyřešeno níže, podle všeho IP adresa na interfejsu v bridgi byla a neměla tam co dělat
Sitovky, ktere se vkladaji do bridge nemaji nastavene IP. Podivej se do /etc/conf.d/net.example.
#----------------------------------------------------------------------------- # Bridging (802.1d) # For bridging support emerge net-misc/bridge-utils # To add ports to bridge br0 #bridge_br0="eth0 eth1" # or dynamically add them when the interface comes up #bridge_add_eth0="br0" #bridge_add_eth1="br0" # You need to configure the ports to null values so dhcp does not get started #config_eth0=( "null" ) #config_eth1=( "null" ) # Finally give the bridge an address - dhcp or a static IP #config_br0=( "dhcp" ) # may not work when adding ports dynamically #config_br0=( "192.168.0.1/24" ) # If any of the ports require extra configuration - for example wireless or # ppp devices - we need to depend on them like so. #RC_NEED_br0="net.eth0 net.eth1" # Below is an example of configuring the bridge # Consult "man brctl" for more details #brctl_br0=( "setfd 0" "sethello 0" "stp off" )
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.