Drahtloses DSL über denselben WLAN-Adapter

460
Ayush Pratap Singh

Ich habe begonnen, Ubuntu 16.04 LTS zu verwenden. Ich vermisse die Funktionalität, meine WLAN-Verbindung oder mein drahtloses Breitband für mein Android-Telefon über dieselbe WLAN-Schnittstelle freigeben zu können.

Ich habe viel im Internet gesucht und über kde-nm-connection-editor und hostapd gelesen. Aber keiner scheint für mich zu funktionieren.

Ich bin auf dieser Seite gelandet, wo der Autor der Frage einen einfachen Weg für eine Problemumgehung hatte, um dies zu tun. Dies ist der Link zur Superuser-Seite der vorherigen Frage.

Ich habe alle Schritte sehr sorgfältig befolgt, stecke aber fest.

Ich habe alles getan, was Sie gesagt haben, aber ich kann den AP immer noch nicht starten, wenn ich renne hostapd -B /etc/hostapd.conf

Ich bekomme den Fehler

$ sudo hostapd -B /etc/hostapd.conf Configuration file: /etc/hostapd.conf Could not set interface ap0 flags (UP): Name not unique on network nl80211: Could not set interface 'ap0' UP nl80211: deinit ifname=ap0 disabled_11b_rates=0 nl80211 driver initialization failed. ap0: interface state UNINITIALIZED->DISABLED ap0: AP-DISABLED  hostapd_free_hapd_data: Interface ap0 wasn't started 

Ich habe versucht, den Namen des Zugangspunkts von new 1 in andere Namen wie ap0 zu ändern, aber es funktioniert immer noch nicht. Bitte helfen

Ich habe die /etc/hostapd.confDatei als Referenz beigefügt .

interface=ap0 driver=nl80211 logger_syslog=-1 logger_syslog_level=2 logger_stdout=-1 logger_stdout_level=2 ssid=wtf country_code=us hw_mode=g channel=10 macaddr_acl=0 auth_algs=3 ignore_broadcast_ssid=0 eap_server=0 wpa=2 wpa_passphrase=12345678 wpa_pairwise=TKIP CCMP rsn_pairwise=TKIP CCMP 

EDIT 1: ON führt folgende Befehle aus, die Ausgänge lauten wie folgt:

**iwconfig** wlp3s0 IEEE 802.11bgn ESSID:"ABESIT 1"  Mode:Managed Frequency:2.462 GHz Access Point: 00:04:56:AC:CB:90  Bit Rate=43.3 Mb/s Tx-Power=15 dBm  Retry short limit:7 RTS thr:off Fragment thr:off Power Management:off Link Quality=56/70 Signal level=-54 dBm  Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:43 Missed beacon:0  enp2s0 no wireless extensions.  lo no wireless extensions.  ppp0 no wireless extensions.  **ip link show** 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: enp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000 link/ether 20:89:84:ea:88:84 brd ff:ff:ff:ff:ff:ff 3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000 link/ether 48:d2:24:4c:15:1d brd ff:ff:ff:ff:ff:ff 5: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1492 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 3 link/ppp   **iw list**  Wiphy phy0  max # scan SSIDs: 4  max scan IEs length: 2257 bytes  Retry short limit: 7  Retry long limit: 4  Coverage class: 0 (up to 0m)  Device supports RSN-IBSS.  Device supports AP-side u-APSD.  Device supports T-DLS.  Supported Ciphers:  * WEP40 (00-0f-ac:1)  * WEP104 (00-0f-ac:5)  * TKIP (00-0f-ac:2)  * CCMP (00-0f-ac:4)  * 00-0f-ac:10  * GCMP (00-0f-ac:8)  * 00-0f-ac:9  * CMAC (00-0f-ac:6)  * 00-0f-ac:13  * 00-0f-ac:11  * 00-0f-ac:12  Available Antennas: TX 0x1 RX 0x1  Configured Antennas: TX 0x1 RX 0x1  Supported interface modes:  * IBSS  * managed  * AP  * AP/VLAN  * WDS  * monitor  * mesh point  * P2P-client  * P2P-GO  * Unknown mode (11)  Band 1:  Capabilities: 0x116e  HT20/HT40  SM Power Save disabled  RX HT20 SGI  RX HT40 SGI  RX STBC 1-stream  Max AMSDU length: 3839 bytes  DSSS/CCK HT40  Maximum RX AMPDU length 65535 bytes (exponent: 0x003)  Minimum RX AMPDU time spacing: 8 usec (0x06)  HT TX/RX MCS rate indexes supported: 0-7  Bitrates (non-HT):  * 1.0 Mbps  * 2.0 Mbps (short preamble supported)  * 5.5 Mbps (short preamble supported)  * 11.0 Mbps (short preamble supported)  * 6.0 Mbps  * 9.0 Mbps  * 12.0 Mbps  * 18.0 Mbps  * 24.0 Mbps  * 36.0 Mbps  * 48.0 Mbps  * 54.0 Mbps  Frequencies:  * 2412 MHz [1] (20.0 dBm)  * 2417 MHz [2] (20.0 dBm)  * 2422 MHz [3] (20.0 dBm)  * 2427 MHz [4] (20.0 dBm)  * 2432 MHz [5] (20.0 dBm)  * 2437 MHz [6] (20.0 dBm)  * 2442 MHz [7] (20.0 dBm)  * 2447 MHz [8] (20.0 dBm)  * 2452 MHz [9] (20.0 dBm)  * 2457 MHz [10] (20.0 dBm)  * 2462 MHz [11] (20.0 dBm)  * 2467 MHz [12] (20.0 dBm) (no IR)  * 2472 MHz [13] (20.0 dBm) (no IR)  * 2484 MHz [14] (disabled)  Supported commands:  * new_interface  * set_interface  * new_key  * start_ap  * new_station  * new_mpath  * set_mesh_config  * set_bss  * authenticate  * associate  * deauthenticate  * disassociate  * join_ibss  * join_mesh  * remain_on_channel  * set_tx_bitrate_mask  * frame  * frame_wait_cancel  * set_wiphy_netns  * set_channel  * set_wds_peer  * tdls_mgmt  * tdls_oper  * probe_client  * set_noack_map  * register_beacons  * start_p2p_device  * set_mcast_rate  * channel_switch  * Unknown command (104)  * connect  * disconnect  Supported TX frame types:  * IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0  * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0  * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0  * AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0  * mesh point: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0  * P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0  * P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0  * P2P-device: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0  Supported RX frame types:  * IBSS: 0x40 0xb0 0xc0 0xd0  * managed: 0x40 0xd0  * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0  * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0  * mesh point: 0xb0 0xc0 0xd0  * P2P-client: 0x40 0xd0  * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0  * P2P-device: 0x40 0xd0  software interface modes (can always be added):  * AP/VLAN  * monitor  valid interface combinations:  * #{ managed } <= 2048, #{ AP, mesh point } <= 8, #{ P2P-client, P2P-GO } <= 1,  total <= 2048, #channels <= 1, STA/AP BI must match  * #{ WDS } <= 2048,  total <= 2048, #channels <= 1, STA/AP BI must match  HT Capability overrides:  * MCS: ff ff ff ff ff ff ff ff ff ff  * maximum A-MSDU length  * supported channel width  * short GI for 40 MHz  * max A-MPDU length exponent  * min MPDU start spacing  Device supports TX status socket option.  Device supports HT-IBSS.  Device supports SAE with AUTHENTICATE command  Device supports low priority scan.  Device supports scan flush.  Device supports AP scan.  Device supports per-vif TX power setting  P2P GO supports CT window setting  Driver supports a userspace MPM  Device supports active monitor (which will ACK incoming frames)  Driver/device bandwidth changes during BSS lifetime (AP/GO mode)  
3
Wenn ich es lese, verwenden Sie diesen Adapter, um Ihr drahtloses Internet zu empfangen, und möchten es dann über denselben Adapter freigeben? Ich bezweifle sehr, dass Sie das schaffen können. Warum kann Ihr Telefon nicht direkt mit dem WLAN verbunden werden? djsmiley2k vor 7 Jahren 1
Das liegt daran, dass das Netzwerk, mit dem ich mich verbinden möchte, drahtloses Breitband (PPPOE) verwendet. Ich habe ein gerootetes Telefon, aber es wird immer noch keine Verbindung mit der verfügbaren WIFI PPPOE-Anwendung hergestellt. Ayush Pratap Singh vor 7 Jahren 0
Und ich bin mir ziemlich sicher, dass dies getan werden kann. Es gibt diesen Link, den ich gepostet habe ... der Autor hat es getan. Gibt es eine Möglichkeit, seine Aufmerksamkeit auf meine Suche zu richten? Sorry, ich bin neu auf dieser Seite ... Ayush Pratap Singh vor 7 Jahren 0
Ausgabe der iw-Liste veröffentlicht. Entschuldigen Sie das Missverständnis. @MariusMatutiae Ayush Pratap Singh vor 7 Jahren 0
Bitte sehen Sie meine bearbeitete Antwort MariusMatutiae vor 7 Jahren 0

1 Antwort auf die Frage

0
MariusMatutiae
valid interface combinations:  * #{ managed } <= 2048, #{ AP, mesh point } <= 8, #{ P2P-client, P2P-GO } <= 1,  total <= 2048, #channels <= 1, STA/AP BI must match  * #{ WDS } <= 2048,  total <= 2048, #channels <= 1, STA/AP BI must match  

Die Ausgabe oben zeigt, dass der AP und die Stationskanäle übereinstimmen müssen : entweder

#channels <= 1 

oder

STA/AP BI must match 

bedeutet das Gleiche, dass Station und AP-Kanal übereinstimmen müssen. Damit Sie keinen Kanal in der Datei hostapd.conf angeben können, müssen Sie sicherstellen, dass der Kanal in der Datei derselbe ist, mit dem Sie bereits über Ihre verwaltete Schnittstelle (oder Station, gleiche Schnittstelle) verbunden sind.

Wie für den Schnittstellen - Namen, aus irgendeinem Grunde bin ich jetzt nicht in der Lage zu machen hostapd Arbeit mit Namen wie new0 und new1, aber wenn ich wlan0 und wlan1 alles funktioniert gut, wie pro meinem Beitrag.

Nachfolgend finden Sie ein einfaches Bash-Skript, das dies für Sie erledigt:

#!/bin/bash  # If you need to debug, uncomment the following statement #set -x # and comment out the "exec" statement.  [ "$USER" != "root" ] && exec sudo $0 "$@" exec 2>/var/log/$(basename $0).log  if [ $# != 2 ]; then echo "Usage $0 interface action" echo "where interface is the name of the wireless interface to be used" echo "and action is one of start/stop " exit 1 fi    MY_IF=$1 HPID=/tmp/host$USER.pid DPID=/tmp/dnsm$USER.pid WPID=/tmp/wpas$USER.pid  [ -x /usr/bin/srm ] && RM=/usr/bin/srm || RM="/bin/rm -f"  stop() {  kill -9 $(cat $HPID) kill -9 $(cat $DPID) dhclient -r kill -9 $(cat $WPID) rm /tmp/*.my_conf rm /tmp/*$USER.pid iw dev wlan1 del ip link set dev $MY_IF down ip addr flush dev $MY_IF ip link set dev $MY_IF up iptables -t nat -D POSTROUTING -o $MY_IF -j MASQUERADE service network-manager start }   my_exit() {  case $1 in 2) echo "wpa_supplicant failed" >>&2  ;; 3) echo "dhclient failed" >>&2  ;; 4) echo "hostapd failed" >>&2  ;; 5) echo "dnsmasq failed" >>&2  ;; esac stop >>&2 exit $1  }    start() { service network-manager stop iw phy phy0 interface add wlan1 type __ap  ip addr flush dev $MY_IF ip link set dev $MY_IF up ip link set dev wlan1 up  pkill -9 wpa_supplicant MYSECRET=$(mktemp /tmp/XXXXXX.my_conf)  echo -e "Please enter BSSID and Password of the Wifi network which\n" echo -e "you wish to connect to:" read BSSID PASSWORD wpa_passphrase $BSSID $PASSWORD > $MYSECRET  wpa_supplicant -B -i $MY_IF -c $MYSECRET -Dnl80211 -P $WPID 1> /dev/null  EXIT_CODE=$? $RM $MYSECRET [[ $EXIT_CODE == 0 ]] && : || my_exit 2    pkill -9 dhclient dhclient $MY_IF [[ $EXIT_CODE == 0 ]] && : || my_exit 3   MYTEMPH=$(mktemp /tmp/XXXXXX.my_conf) MYTEMPD=$(mktemp /tmp/XXXXXX.my_conf)  cat > $MYTEMPH <<EOF interface=wlan1 driver=nl80211 logger_syslog=-1 logger_syslog_level=2 logger_stdout=-1 logger_stdout_level=2 ssid=wtf hw_mode=g channel=3 macaddr_acl=0 auth_algs=3 ignore_broadcast_ssid=0 eap_server=0 wpa=2 wpa_passphrase=12345678 wpa_pairwise=TKIP CCMP rsn_pairwise=TKIP CCMP EOF pkill -9 hostapd /usr/sbin/hostapd -B -P $HPID $MYTEMPH 1> /dev/null sleep 3 ps ax | grep hostapd | grep -v grep >/dev/null if [[ ! $? == 0 ]]; then  /usr/sbin/hostapd -B -P $HPID $MYTEMPH 1> /dev/null fi [[ $? == 0 ]] && : || my_exit 4   echo 1 >/proc/sys/net/ipv4/ip_forward   ip addr add 10.111.113.1/24 dev wlan1 cat > $MYTEMPD <<EOF domain-needed bogus-priv dhcp-authoritative no-dhcp-interface=$MY_IF no-dhcp-interface=lo interface=wlan1 server=8.8.8.8 server=8.8.4.4 expand-hosts dhcp-range=10.111.113.2,10.111.113.100,12h EOF pkill -9 dnsmasq dnsmasq -C $MYTEMPD -x $DPID [[ $? == 0 ]] && : || my_exit 5 iptables -t nat -A POSTROUTING -o $MY_IF -j MASQUERADE  }    case $2 in start) stop >>&2 start ;; stop) stop ;; *)  echo "Usage $0 interface action" echo "where interface is the name of the wireless interface to be used" echo "and action is one of start/stop " ;;  esac 

Stellen Sie sicher, dass der Kanal von hostapd.conf im obigen Skript (der Zeilenkanal = 3 ) mit demjenigen AP übereinstimmt, zu dem Sie eine Verbindung herstellen möchten. Ich habe nicht nach links, in den oben genannten, set -x, die Sie Fehler sehen kann, wenn überhaupt, wie das Skript fort: Wenn Sie einige Debug tun müssen, können Sie un kommentieren. Ich konnte hostapd nicht erstellen, wenn er aus einem Skript wie oben aufgerufen wurde, mit etwas anderem als country_code = us funktioniert, aber Sie haben vielleicht mehr Glück. Meine Version von Hostapd schlägt auch jedes Mal fehl, so dass ich eine Bedingung hinzugefügt habe, die testet, ob Hostapd ausgeführt wird oder nicht, und es versuchtgenau noch einmal, um es anzufangen.

OK, ich melde mich mit den Ausgaben davon ... Aber ich bin mir sicher, dass ich verschiedene Namen verwendet habe. Ich habe den Namen für Station auf new0 gesetzt, wie Sie es in Ihrer Konfiguration erklärt haben, und den AP-Namen zuerst auf new1. Als es nicht funktionierte, habe ich auch ap0 ausprobiert, aber immer noch nicht funktioniert ... Ayush Pratap Singh vor 7 Jahren 0
Das O / P ist wie folgt: Liste: wlp3s0 IEEE 802.11bgn ESSID: Modus "ABESIT 1": Verwaltete Frequenz: 2,462 GHz Zugriffspunkt: 00: 04: 56: AC: CB: 90 Bitrate = 43,3 Mb / s Tx-Power = 15 dBm Retry short limit: 7 RTS thr: off Fragment thr: off Energieverwaltung: off Verbindungsqualität = 56/70 Signalpegel = -54 dBm Rx ungültig nwid: 0 Rx ungültig Krypta: 0 Rx ungültig Frag: 0 Tx übermäßige Neuversuche : 0 Ungültiger Fehler: 43 Verpasste Bake: 0 enp2s0 Keine Wireless-Erweiterungen. Es gibt keine drahtlosen Erweiterungen. ppp0 keine drahtlosen Erweiterungen. Ayush Pratap Singh vor 7 Jahren 0
Ich habe die Ausgabe oben gepostet ... Ayush Pratap Singh vor 7 Jahren 0