garywill / linux-router

Set Linux as router in one command. Support Internet sharing, redsocks, Wifi hotspot, IPv6. Can also be used for routing VM/containers 🛰️ (也欢迎关注B站 https://space.bilibili.com/2123686105 )
GNU Lesser General Public License v2.1
1.71k stars 152 forks source link

wifi hotspot #14

Closed WassimAttar closed 3 years ago

WassimAttar commented 3 years ago

Hello ! I'm not reporting an issue but asking for the magical command line to get the wifi hotspot working. Here is my configuration : eth0 : lan with an IP and internet access wlan0 : wifi without an IP and no internet access

test@test:~$ ip a
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 10:11:22:33:44:55 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.28/24 brd 192.168.1.255 scope global dynamic enp4s0
       valid_lft 83279sec preferred_lft 83279sec
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether aa:bb:cc:dd:ee:ff brd ff:ff:ff:ff:ff:ff

My goal is to enable the wifi hostpot and have internet on it. When i launch sudo lnxrouter --no-virt --ap wlan0 MyAccessPoint -p MyPassPhrase With another device i'm connected to the wifi hostpost but no internet on it.

test@test:~$ ip a
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 10:11:22:33:44:55 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.28/24 brd 192.168.1.255 scope global dynamic enp4s0
       valid_lft 82678sec preferred_lft 82678sec
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether aa:bb:cc:dd:ee:ff brd ff:ff:ff:ff:ff:ff
    inet 192.168.145.1/24 brd 192.168.145.255 scope global wlan0
       valid_lft forever preferred_lft forever

What is the magical command line to get internet on the wifi hotspot ?

Thanks a lot for your help !

WassimAttar commented 3 years ago

My bad. Everything is working. The DNS server wasn't declared on eth0.