Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index International Gentoo Users Deutsches Forum (German)
  • Search

adhoc -> wlan0 bridge zu eth0 (geloest)

Support-Forum
Diskussionen rund um Installation, Betrieb und Anpassungen von Gentoo und dessen Paketen sowie dabei auftretenden (technischen) Problemen.
Deutsches Portal: www.gentoo.de
Post Reply
  • Print view
Advanced search
11 posts • Page 1 of 1
Author
Message
andi_s
Apprentice
Apprentice
User avatar
Posts: 226
Joined: Thu Feb 10, 2005 6:11 pm
Location: Germany

adhoc -> wlan0 bridge zu eth0 (geloest)

  • Quote

Post by andi_s » Sat Oct 23, 2010 3:56 pm

hallo,

ich moechte mit einem mobilen geraet eine internetverbindung aufbauen.
da ich keinen wlan access point habe, moechte ich eine adhoc verbindung zu meinem gentoo rechner (wlan0) aufbauen, der ueber eth0 mit dem internet verbunden ist.

ich denke das muesste mit bridging moeglich sein.

meine einstellungen:
802.1d Ethernet Bridging ist im kernel aktiviert
bridge-utils sind emerged
mein dsl-router/gateway hat die ip 192.168.1.1
mein gentoo-pc hat die ip 192.168.1.2
mein wlan0 hat die ip 192.168.1.3
mein mobiles geraet hat die ip: 192.168.1.4, gateway 192.168.1.1, dns 192.168.1.1

nun ertelle ich eine bridge zwischen wlan0 und eth0 und danach baue ich eine adhoc-verbindung mit 'test' her.

das ergebnis:
ping 192.168.1.3 von meinem mobilen geraet: OK
ping 192.168.1.4 von meinem gentoo-rechner: OK
internet zugriff von meinem gentoo-rechner: OK
internet zugriff von meinem mobilen geraet: nicht moeglich :(

da die grundeinstellungen soweit funktionieren, denke ich das nicht viel fehlt, um auch die letzte huerde zu bewaeltigen, nur fehlen mir da leider die kenntnisse.

ich hoffe hier findet sich jemand, der mir erklaeren kann, was ich falsch mache bzw. was fehlt und wie ich das problem beheben kann.
Last edited by andi_s on Wed Oct 27, 2010 2:28 pm, edited 2 times in total.
Top
Hollowman
Guru
Guru
Posts: 584
Joined: Thu Apr 19, 2007 6:34 pm

  • Quote

Post by Hollowman » Sat Oct 23, 2010 4:21 pm

Wie pings du von deinem Mobilen Gerät?

Pingst du eine Adresse z.B. www.google.de oder pingst du die IP von google?

Falls du die Adresse pingst, versuch es doch bitte mal mit der IP: 74.125.39.105 Geht das? wenn ja fehlt deinem Mobilen Gerät der Nameserver (DNS).

Was sagt ein ping 192.168.1.1 ?

Sebastian
Top
Christian99
Veteran
Veteran
Posts: 1769
Joined: Thu May 28, 2009 5:20 pm

  • Quote

Post by Christian99 » Sat Oct 23, 2010 4:29 pm

ich glaube du musst deinem mobilen gerät als gateway die adresse des routers geben, denn bridging != routing. Dein mobiles Gerät weiß nichts von der Bridge, und kann direkt mit allen anderen im netzwerk reden.
Und wenn du auf deiner gentookiste keinen dns-server laufen hast, musst du den DNS server am mobilen gerät auch auf 192.168.1.1 setzen.
Top
andi_s
Apprentice
Apprentice
User avatar
Posts: 226
Joined: Thu Feb 10, 2005 6:11 pm
Location: Germany

  • Quote

Post by andi_s » Sun Oct 24, 2010 7:36 am

@hollowman
ich kann von meinem mobilen geraet leider nur die bridge (192.168.1.2) anpingen. ich verstehe schon was du meinst - du denkst es liegt am dns. da sich aber keine ip's ausser der bridge vom mobilgeraet anpingen lassen habe ich das ausgeschlossen. ich hatte vorher auch schon im mobilgeraete statisch dns-server eingetragen - selber effekt.

@Christian99
ich hatte im mobilen geraet urspruenglich auch 192.168.1.1 als gateway eingetragen, nur da ich das gateway nicht anpingen konnte habe ich dort mal testweise 192.168.1.2 eingetragen.

ich gehe auch davon aus das das routing das problem ist, da ich wie gesagt vom mobilgeraet nichts anderes erreichen kann als die bridge. was vielleicht helfen wuerde, waere eine umleitung der pakete mit iptables regeln, nur kenne ich mich mit ip-forwarding/masquerading leider ueberhaupt nicht aus. ich hoffe das hier jemand die benoetigten regeln parat hat.
Top
Hollowman
Guru
Guru
Posts: 584
Joined: Thu Apr 19, 2007 6:34 pm

  • Quote

Post by Hollowman » Sun Oct 24, 2010 10:07 am

Warum machst du das eigentlich so umständlcih über die Bridge?

Guck dir mal Hostap an. Dann fungiert dein Gentoo Rechner als WLAN AccessPoint. Dann brauchst du den ganzen Bridge Kram nicht.

Noch besser wäre es wenn du dir einfach ein DSL Router mit WLAn kaufst, die kosten doch nur ein Appel und ein Ei. Das ist auf die Dauer die wesentlich bessere Lösung.

Sebastian
Top
andi_s
Apprentice
Apprentice
User avatar
Posts: 226
Joined: Thu Feb 10, 2005 6:11 pm
Location: Germany

  • Quote

Post by andi_s » Sun Oct 24, 2010 1:58 pm

klar, hast ja im prinzip recht, aber...

- hostap war auch meine erste wahl, nur mein usbstick hat leider einen chipsatz, der nicht von hostap unterstuetzt wird :(
- ja, ein wlan router kostet 'nix', aber ich benoetige wlan eher selten und wenn 'im prinzip' alles vorhanden ist wozu dann noch eine steckdose belegen? ich will es halt mit boardmitteln loesen - das sollte ja auch machbar sein... ;)
Top
Hollowman
Guru
Guru
Posts: 584
Joined: Thu Apr 19, 2007 6:34 pm

  • Quote

Post by Hollowman » Sun Oct 24, 2010 2:18 pm

Du belegst doch keine weitere Steckdose. Du schmeißt dein jetztiges DSL Gateway raus und hängst eins mit WLAn hin.

Sebastian
Top
r3tep
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 108
Joined: Sat Sep 10, 2005 2:28 pm
Contact:
Contact r3tep
Website

  • Quote

Post by r3tep » Sun Oct 24, 2010 3:51 pm

Ich habe bei mir folgende Geräte:

Erdgeschoss: Router (192.168.1.1)
Dachgeschoss: Gentoo-Desktop (wlan0: 192.198.1.4 + eth0: 192.168.2.1) mit kabelloser Verbindung zum Router
Dachgeschoss: Alter Rechner (eth0: 192.168.2.2) mit Kabelverbindung zum Gentoo-Desktop

Der alte Rechner geht über den Desktop ins Internet, welcher für den alten Rechner als Router fungiert.

Zum Routen reicht da im Prinzip iptables aus. Ich verwende als Aufsatz dazu firehol.

Bei andi_s kommt dann halt noch die Verwaltung der Adhoc-Verbindung dazu.
Top
andi_s
Apprentice
Apprentice
User avatar
Posts: 226
Joined: Thu Feb 10, 2005 6:11 pm
Location: Germany

  • Quote

Post by andi_s » Sun Oct 24, 2010 3:56 pm

wie gesagt ich will das ohne wlan router loesen...

daher habe ich inzwischen auf eine direkte usb-kabel-verbindung (ethernet gadget 'usb0') umgestellt und ich habe exakt das selbe problem (setup ist im prinzip auch identisch, nur eben das es nicht ueber wlan0 geht sondern usb0), d.h. die geraete untereinander kommunizieren (ping: OK) nur mit dem mobilen geraet komme ich einfach nicht ins internet :(
Top
r3tep
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 108
Joined: Sat Sep 10, 2005 2:28 pm
Contact:
Contact r3tep
Website

  • Quote

Post by r3tep » Tue Oct 26, 2010 7:23 am

Du kannst das ähnlich dem von mir dargestellten Setup lösen, ohne zusätzliche Hardware kaufen zu müssen:

Stationärer PC: eth0 (192.168.1.1 zum Internet) wlan0/usb0 (192.168.2.1 Schnittstelle zum Mobilen Gerät)
Mobiles Gerät: wlan0/usb0 (192.168.2.2 Schnittstelle zum stationären PC)

Der stationäre PC soll hier als Router funktionieren, wobei iptables das Routing übernehmen soll. Die für iptables benötigten Regeln entweder selber schreiben oder z.B. über firehol generieren lassen.

Bei mir läuft firehol damit:

Code: Select all

# INFO: Processing interface 'eth0'
# INFO: Processing IP 192.168.2.1 of interface 'eth0'
# INFO: Is 192.168.2.1 part of network 192.168.2.0/24? yes

# Interface No 1.
# The purpose of this interface is to control the traffic
# on the eth0 interface with IP 192.168.2.1 (net: "192.168.2.0/24").
interface eth0 LAN #src "192.168.2.0/24" dst 192.168.2.1

        # The default policy is DROP. You can be more polite with REJECT.
        # Prefer to be polite on your own clients to prevent timeouts.
        policy drop

        # If you don't trust the clients behind eth0 (net "192.168.2.0/24"),
        # add something like this.
        # > protection strong

        # Here are the services listening on eth0.
        # TODO: Normally, you will have to remove those not needed.
        server cups accept
        server dns accept
        server ICMP accept
        server syslog accept

        # The following means that this machine can REQUEST anything via eth0.
        # TODO: On production servers, avoid this and allow only the
        #       client services you really need.
        client all accept

# INFO: Processing interface 'wlan0'
# INFO: Processing IP 192.168.1.2 of interface 'wlan0'
# INFO: Is 192.168.1.2 part of network 192.168.1.0/24? yes

# Interface No 2.
# The purpose of this interface is to control the traffic
# on the wlan0 interface with IP 192.168.1.2 (net: "192.168.1.0/24").
# TODO: Remove 'dst 192.168.1.2' if this is dynamically assigned.
interface wlan0 WAN #src "192.168.1.0/24" dst 192.168.1.2

        # The default policy is DROP. You can be more polite with REJECT.
        # Prefer to be polite on your own clients to prevent timeouts.
        policy drop

        # If you don't trust the clients behind wlan0 (net "192.168.1.0/24"),
        # add something like this.
        # > protection strong

        # Here are the services listening on wlan0.
        # TODO: Normally, you will have to remove those not needed.
        server cups accept
        server dns accept
        server ICMP accept

        # The following means that this machine can REQUEST anything via wlan0.
        # TODO: On production servers, avoid this and allow only the
        #       client services you really need.
        client all accept

# The above 2 interfaces were found active at this moment.
# Add more interfaces that can potentially be activated in the future.
# FireHOL will not complain if you setup a firewall on an interface that is
# not active when you activate the firewall.
# If you don't setup an interface, FireHOL will drop all traffic from or to
# this interface, if and when it becomes available.
# Also, if an interface name dynamically changes (i.e. ppp0 may become ppp1)
# you can use the plus (+) character to match all of them (i.e. ppp+).


# Router No 1.
# Clients on eth0 (from "192.168.2.0/24") accessing servers on wlan0 (to "192.168.1.0/24").
# TODO: Change "router1" to something with meaning to you.
# TODO: Check the optional rule parameters (src/dst).
router router1 inface eth0 outface wlan0 #src "192.168.2.0/24" dst "192.168.1.0/24"

        # If you don't trust the clients on eth0 (from "192.168.2.0/24"), or
        # if you want to protect the servers on wlan0 (to "192.168.1.0/24"),
        # uncomment the following line.
        # > protection strong

        # To NAT client requests on the output of wlan0, add this.
        masquerade
        # Alternatively, you can SNAT them by placing this at the top of this config:
        # > snat to 192.168.1.2 outface wlan0 src "192.168.2.0/24" dst "192.168.1.0/24"
        # SNAT commands can be enhanced using 'proto', 'sport', 'dport', etc in order to
        # NAT only some specific traffic.

        # TODO: This will allow all traffic to pass.
        # If you remove it, no REQUEST will pass matching this traffic.
        route all accept


# Router No 2.
# Clients on wlan0 (from "192.168.1.0/24") accessing servers on eth0 (to "192.168.2.0/24").
# TODO: Change "router2" to something with meaning to you.
# TODO: Check the optional rule parameters (src/dst).
router router2 inface wlan0 outface eth0 #src "192.168.1.0/24" dst "192.168.2.0/24"

        # If you don't trust the clients on wlan0 (from "192.168.1.0/24"), or
        # if you want to protect the servers on eth0 (to "192.168.2.0/24"),
        # uncomment the following line.
        # > protection strong

        # To NAT client requests on the output of eth0, add this.
        masquerade
        # Alternatively, you can SNAT them by placing this at the top of this config:
        # > snat to 192.168.2.1 outface eth0 src "192.168.1.0/24" dst "192.168.2.0/24"
        # SNAT commands can be enhanced using 'proto', 'sport', 'dport', etc in order to
        # NAT only some specific traffic.

        # TODO: This will allow all traffic to pass.
        # If you remove it, no REQUEST will pass matching this traffic.
        route all accept
Top
andi_s
Apprentice
Apprentice
User avatar
Posts: 226
Joined: Thu Feb 10, 2005 6:11 pm
Location: Germany

  • Quote

Post by andi_s » Wed Oct 27, 2010 2:34 pm

@r3tep

danke, ich habs mit masquerading/forwarding hinbekommen! :)
Top
Post Reply
  • Print view

11 posts • Page 1 of 1

Return to “Deutsches Forum (German)”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic