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
  • 582
2

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