thuranga
Posts: 9
Joined: Fri Jan 02, 2015 12:13 pm
Location: DE

[SOLVED] Raspberry as Access Point (Hotspot) AND Client

Sat Mar 14, 2015 4:43 pm

Hi,
I set up my Pi successful as an access point. Everything works fine. Here is my /etc/network/interfaces :

Code: Select all

auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0
iface eth0 inet static
    address 192.168.178.220
    netmask 255.255.255.0
    gateway 192.168.178.1

auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
    address 192.168.66.1
    netmask 255.255.255.0
    broadcast 192.168.66.255

Code: Select all

# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether b8:27:eb:98:3f:17 brd ff:ff:ff:ff:ff:ff
    inet 192.168.178.220/24 brd 192.168.178.255 scope global eth0
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 74:da:38:1a:95:90 brd ff:ff:ff:ff:ff:ff
    inet 192.168.66.1/24 brd 192.168.66.255 scope global wlan0
       valid_lft forever preferred_lft forever
Now I installed a second WLAN-Interface (wlan1) to access the new WLAN as a client with my PI too. How do I configure the network?

I tried the following:

Code: Select all

auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0
iface eth0 inet static
    address 192.168.178.220
    netmask 255.255.255.0
    gateway 192.168.178.1

auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
    address 192.168.66.1
    netmask 255.255.255.0
    broadcast 192.168.66.255

auto wlan1
allow-hotplug wlan1
iface wlan1 inet static
    address 192.168.66.220
    netmask 255.255.255.0
    gateway 192.168.66.1
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
but now my hotspot (wlan0) gone away:

Code: Select all

# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether b8:27:eb:98:3f:17 brd ff:ff:ff:ff:ff:ff
    inet 192.168.178.220/24 brd 192.168.178.255 scope global eth0
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 74:da:38:1a:95:90 brd ff:ff:ff:ff:ff:ff
4: wlan1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
    link/ether 74:da:38:05:0f:b8 brd ff:ff:ff:ff:ff:ff
    inet 192.168.66.220/24 brd 192.168.66.255 scope global wlan1
       valid_lft forever preferred_lft forever
Can anyone help me to set up my Pi as hotspot AND client?

Greetings
Frank
Last edited by thuranga on Mon Mar 23, 2015 12:20 pm, edited 2 times in total.

User avatar
DougieLawson
Posts: 36544
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Using the Raspberry as Access Point (Hotspot) AND Client

Sat Mar 14, 2015 5:16 pm

Have you removed ifplugd with sudo apt-get purge ifplugd?
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

thuranga
Posts: 9
Joined: Fri Jan 02, 2015 12:13 pm
Location: DE

Re: Using the Raspberry as Access Point (Hotspot) AND Client

Sat Mar 14, 2015 5:22 pm

No, I did not remove ifplugd.

User avatar
DougieLawson
Posts: 36544
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Using the Raspberry as Access Point (Hotspot) AND Client

Sat Mar 14, 2015 5:34 pm

thuranga wrote:No, I did not remove ifplugd.
There's your problem ifplugd is there to ensure you only ever have ONE active network interface. [I've yet to discover why ifplugd is needed or installed by default.]
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

thuranga
Posts: 9
Joined: Fri Jan 02, 2015 12:13 pm
Location: DE

[SOLVED] Using Raspberry as Access Point (Hotspot) AND Clien

Sat Mar 14, 2015 5:47 pm

Wow! You are great!!!

Code: Select all

# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether b8:27:eb:98:3f:17 brd ff:ff:ff:ff:ff:ff
    inet 192.168.178.220/24 brd 192.168.178.255 scope global eth0
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 74:da:38:1a:95:90 brd ff:ff:ff:ff:ff:ff
    inet 192.168.66.1/24 brd 192.168.66.255 scope global wlan0
       valid_lft forever preferred_lft forever
4: wlan1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
    link/ether 74:da:38:05:0f:b8 brd ff:ff:ff:ff:ff:ff
    inet 192.168.66.220/24 brd 192.168.66.255 scope global wlan1
       valid_lft forever preferred_lft forever
Now I can ping a machine at my "old" wlan and my iPhone, which is connected via hotspot! I think this is the solution! I will check it :D

Thanx a lot!!!!!

Update:
I verified and optimized my config and now everything works fine. If anyone is interested in the config to create a hotspot, you can look here (sorry, its only in german): http://www.linux-ratgeber.de/den-raspbe ... inrichten/ and http://www.linux-ratgeber.de/den-raspbe ... inrichten/
Last edited by thuranga on Mon Mar 23, 2015 12:17 pm, edited 1 time in total.

ronnyvdbr
Posts: 68
Joined: Sun Mar 01, 2015 8:42 pm

Re: Using the Raspberry as Access Point (Hotspot) AND Client

Sat Mar 14, 2015 9:09 pm

Hi, you might check out this project for a web gui for your hotspot.
In the php code u will find a lot of example shell commands which explain how the configuration is done.
https://ronnyvdbr.github.io

Return to “Networking and servers”