1

I wanted to create a hotspot with this tutorial : How to setup an Access Point mode Wi-Fi Hotspot?

Part : Whether your wireless card support Access Point mode.

When i tried manually , i think it was good but i'm not sure because 3g data was activated in background :/.

But after tried their script and modify a litlle because it does not work on my linux , i think that i screwed up iptables when i flush them or anything, i don't know really. Now i have a "!" on the wifi on my phone and i can't have internet on this but i'm connected on the hotspot. So i don't know where is the problem , i think it's not very complicated but after 3 hours and try a lot of without success, Really i don't understand what is my problem :/.

I hope that you will can help me. I don't found all iptables , if you have any command that you want i write , i will do that :).

Lenovo-Flex-2-14:~$ sudo iptables -L -n
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Thank you for your help and sorry if for the beggin i haven't code or anything to give you in this case :/

PS : Phone : android 5.1 ( not very important i guess ) Computer : Ubuntu 15.10

2 Answers2

3

I will tell you a step by step procedure for setting up a hotspot in ubuntu and sharing your Internet with it (with less headache). First you need to install two packages

sudo apt-get install hostapd bridge-utils

Now edit /etc/hostapd/hostapd.conf with (If not present create it)

interface=wlan0
bridge=br0
ssid=YOUR_SSID
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=YOUR_PASSWORD
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
macaddr_acl=0

Make it live by Editing /etc/default/hostapd, set the line to be:

DAEMON_CONF="/etc/hostapd/hostapd.conf"

Now Bridge the network connections. Open /etc/network/interfaces. Assuming that eth0 is the internet source of your system. Change the configuration something like this.(Make sure to remove iface wlan0)

#loopback adapter
auto lo
iface lo inet loopback
#wired adapter
iface eth0 inet dhcp
#bridge
auto br0
iface br0 inet dhcp
bridge_ports eth0 wlan0

Make hostapd to be run everytime on boot:

sudo update-rc.d hostapd enable

Now reboot.. You can start or stop hostapd with

sudo service hostapd stop

or

sudo service hostapd start

Note: Booting may take a little time if one/both of the interface fails (eth0 wlan0). For example, if you are using an external usb wifi card and removed it while booting, Bridging will fail, hence increase in overall booting time.

Sijin T V
  • 552
  • thank you , but even after to follow your tuto, ,on my phone i see the wireless but during the connexion , i get the message : "authentification error" and it can't to connect at this network :/. Any idea ? – kevin caradant Nov 19 '15 at 22:42
  • Oki sorry , it was the password , i forgot to edit so the network bugged ... now work like a charm , think you , it was so easy intead of dhcp etc where this take me 6hours ^ – kevin caradant Nov 19 '15 at 22:48
  • NB : if i could , i would give you +1 but i haven't much reputations :/ . I created a script if that can be usefull for someone : https://github.com/kevincaradant/script_hotspot_linux.git . Sorry for the repository ( new repo ) , i rewrite more later the read me :) – kevin caradant Nov 20 '15 at 00:05
  • Mhh just a question , i don't remember if it was like that at the beginning , but Ethernet and Wifi are " Device Not Managed " when i modify with your config on /etc/network/interfaces , so i can't put my vpn on Ethernet :/ , is it possible ? – kevin caradant Nov 20 '15 at 10:31
  • http://imgur.com/V8362wg this is my network manager – kevin caradant Nov 20 '15 at 10:40
  • try putting the vpn on br0 instead, in the terminal way – Sijin T V Nov 20 '15 at 14:04
  • Must I to follow this tuto : http://powtos.fr/255-openvpn-bridge/ ? It seems to be complicated because you have to edit the server and also the client with a bridge from eth0 to tap0(vpn) and then with your way , in /etc/network/interface , you have to create an other bridge from tap0 to wlan0 ? or i have nothing understood :/. If you have an idea @Sijin Krishnan i listen you ;) – kevin caradant Nov 20 '15 at 18:06
1

The same symptoms, different issue – Docker blocked forwarding on the computer (ticket).

Can be resolved via:

iptables -I DOCKER-USER -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -I DOCKER-USER -i wlan0 -o eth0 -j ACCEPT
  • 1
    Same here (debian). Note that your network interface names might be different, find out with ip a s (address show). – Felix Feb 11 '24 at 13:47