Coder Social home page Coder Social logo

garywill / linux-router Goto Github PK

View Code? Open in Web Editor NEW
1.6K 25.0 142.0 252 KB

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 )

License: GNU Lesser General Public License v2.1

Shell 100.00%
linux router gateway wifi-hotspot transparent-proxy redsocks create-ap nat nated-wifi-access-point internet-sharing

linux-router's Introduction

linux-router's People

Contributors

cabbache avatar garywill avatar kphanipavan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

linux-router's Issues

How to give connected devices unique IPs?

I currently am using a Linux server as a WiFi hotspot using the following command:

lnxrouter --ap myaccesspoint -p mypassword --no-virt

However, the public IP address on any device that is connected to the internet through the server has the same IP as the server, whereas I was hoping that all my devices would have their own public IP.

How can I achieve this?

proxy forwarding not working

thank you for your awesome effort in putting the script together.
I am trying to test with AP and PROXY. AP works fine with following command ./lnxrouter -o eth0 --ap wlan0 AP_NAME --password AP_PASS, I am able to connect my android device and internet is working. When I try to launch with --tp PORT option my phone no longer gets internet.

I have validated my redsocks is setup properly by following steps

  1. iptables -t nat -A OUTPUT -p tcp --dport 80 -j REDIRECT --to-port 12345
  2. curl http://yahoo.com
    in redsocks logs I see curl is making connection.

I am using Ubuntu Server on VM Ware Fusion on Mac

lsb_release -a

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 14.04.5 LTS
Release:	14.04
Codename:	trusty 

Internet access from ethernet doesn't seem to work.

I'm trying to simply get an AP that forwards the internet access from ethernet (eth0 in my case) on a raspberry pi. However when I connect to that AP it doesn't seem to be able to connect to any internet address. My command looks like this: sudo ./lnxrouter --ap wlan0 MyAP -o eth0

how to route TO/FROM local LXD bridge interface and local VPN interface

Just found linux-router tool and it looks very promising for a lot of things.

I have a question on use though. Many VPN's only implement a TUN device (TUN - TCP vs TAP - ethernet).

If I were using WireGuard or Nebula can your tool enable traffic from a NODE's lxdbr0 bridge interface (LXD) to/from the VPN interface.

example:
using Wireguard it creates an interface on the NODE called "wg0"
or if using Nebula it creates an interface on the NODE called "nebula1"

I was hoping the following might work for wireguard if configured on NODE1 and NODE1 (both ubuntu 18.04

$ sudo ./linux-router.sh -i lxdbr0 -o wg0 --daemon
$ sudo ./linux-router.sh -i wg0 -o lxdbr0 --daemon

But from NODE1 I am not able to ping NODE2's lxdbr0 interface although I can ping the WireGuard interface (wg0) on NODE2.

Since it looks like you've used LXD I thought I'd ask how this might be done with your linux-router?

thanks for any information

brian

Hotspot successfully created - Cannot connect from any device - Obtaining IP Address

Hello. I've been trying to setup a working hotspot for quite some time now.
Internet is provided to the laptop via USB-A ethernet adapter, laptop has Realtek wifi interface that supports AP mode and other modes. Running on KDE Neon (with Plasma) latest version. WIFI Hotspot worked flawlessly on Windows 10.

I would like to post logs of what happens when i try to connect from Android phone / other devices, but don't know how to log (complete newbie). I tried to run the lnxrouter command in various ways, but can't manage to get any device connected, Android phone shows that it is stuck on "obtaining ip address".

Integration with traffic control

What a cool project!

The immediate use case I see for this is quick virtual network labs for education and application testing (e.g. how does the pcap differ when it's network delay vs server delay), so integration with tc would be fantastic to introduce delay and loss into the network path.

I would be happy to help build that, but don't have any time immediately available. So I thought I would at least log an enhancement request.

iptables: Couldn't load match `comment':No such file or directory

Upon running sudo lnxrouter --ap wlan0 Alex -p #### iptables fails.

WARN: brmfmac driver doesn't work properly with virtual interfaces and
      it can cause kernel panic. For this reason we disallow virtual
      interfaces for your adapter.
      For more info: https://github.com/oblique/create_ap/issues/203
WARN: Your adapter does not fully support AP virtual interface, enabling --no-virt
PID: 3969
Target interface is wlan0 (dc:a6:32:ae:05:4b)
Use random LAN IPv4 address 192.168.77.1
haveged_watchdog PID: 4041

Starting hostapd
hostapd PID: 4044
Configuration file: /dev/shm/lnxrouter_tmp/lnxrouter.wlan0.conf.ycq/hostapd.conf
wlan0: Could not connect to kernel driver
Using interface wlan0 with hwaddr dc:a6:32:ae:05:4b and ssid "Alex"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED

iptables: NAT
iptables v1.8.2 (nf_tables): Couldn't load match `comment':No such file or directory

Try `iptables -h' or 'iptables --help' for more information.
Error occured


Doing cleanup..
Terminated
Killed 4041 lnxrouter
wlan0: interface state ENABLED->DISABLED
wlan0: AP-DISABLED
wlan0: CTRL-EVENT-TERMINATING
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Killed 4044 hostapd
iptables: stop NAT
iptables: unallow DNS
iptables: unallow dhcp
Exiting: This is the only running instance
Cleaning up done

这个对NM的网络管理不管用吧?

试了一下 报错了

sudo ./lnxrouter --ap wlan0 test
PID: 10782
Target interface is wlan0
Creating a virtual WiFi interface... 
x0wlan0 created.
WARN: Wifi is not protected by password
Set x0wlan0 unmanaged by NetworkManager
haveged_watchdog PID: 10873

Starting hostapd
hostapd PID: 10877
Configuration file: /dev/shm/lnxrouter_tmp/lnxrouter.wlan0.conf.ISX/hostapd.conf
Using interface x0wlan0 with hwaddr 6c:71:d9:1b:c4:b5 and ssid "test"
x0wlan0: interface state UNINITIALIZED->ENABLED
x0wlan0: AP-ENABLED 

iptables: NAT 
MASQUERADE  all opt -- in * out !x0wlan0  192.168.18.0/24 !-> 192.168.18.0/24   /* lnxrouter-10782-x0wlan0 */
ACCEPT  all opt -- in x0wlan0 out *  192.168.18.0/24  -> 0.0.0.0/0   /* lnxrouter-10782-x0wlan0 */
ACCEPT  all opt -- in * out x0wlan0  0.0.0.0/0  -> 192.168.18.0/24   /* lnxrouter-10782-x0wlan0 */

iptables: allow DNS port access
ACCEPT  tcp opt -- in x0wlan0 out *  192.168.18.0/24  -> 192.168.18.1   tcp dpt:53 /* lnxrouter-10782-x0wlan0 */
ACCEPT  udp opt -- in x0wlan0 out *  192.168.18.0/24  -> 192.168.18.1   udp dpt:53 /* lnxrouter-10782-x0wlan0 */

iptables: allow DHCP port access
ACCEPT  udp opt -- in x0wlan0 out *  0.0.0.0/0  -> 0.0.0.0/0   udp dpt:67 /* lnxrouter-10782-x0wlan0 */
Setting /usr/sbin/dnsmasq to complain mode.

ERROR: Path doesn't start with / or variable: libvirt_leaseshelper

Starting dnsmasq
dnsmasq PID: 10938

dnsmasq: cannot read /dev/shm/lnxrouter_tmp/lnxrouter.wlan0.conf.ISX/dnsmasq.conf: Permission denied
Error occured

ERROR: dnsmasq exited

Error occured


Doing cleanup.. 
Killed 10873 lnxrouter
x0wlan0: interface state ENABLED->DISABLED
x0wlan0: AP-DISABLED 
nl80211: deinit ifname=x0wlan0 disabled_11b_rates=0
Killed 10877 hostapd
iptables: stop NAT
iptables: stop allowing DNS
iptables: stop dhcp
Exiting: This is the only running instance
Restore x0wlan0 managed by NetworkManager
Cleaning up done
已杀死

script reconfiguring local interface and cutting off local ssh

Hi,

I cant find a way to run the script without killing my own link to the system.

On the 'router':
eth0 is on 192.168.166.100 (Im connecting to it from 192.168.166.110 via ssh)
wlan0 is the link to the internet (no firewalls, no VPNs etc.. simple wifi).

I tried both:
sudo lnxrouter -i eth0 -o wlan0
and:
sudo lnxrouter -i eth0 -o wlan0 -g 192.168.166.100

Both killed my link to the 'router' from eth0.
Am I missing something?
Thanks

Unable to create wifi-hotspot on Raspberry Pi 3

The raspberry only has a wlan interface, no ethernet. I want to create a wifi hotspot on the raspberry so that I can connect to the raspberry from other devices (e.g. via ssh).
I tried the following command:
sudo lnxrouter -n --ap wlan0 MyAccessPoint --no-virt
Beforehand I disabled wifi via sudo rfkill block wifi.

I can see the message Setting up completed.... The hotspot is present for a few seconds, but then disappears. After a few seconds I get this message:
dnsmasq: failed to create listening socket for 192.168.178.28: Address already in use
However, the used IP address is 192.168.19.1 and DHCP range is 192.168.19.10 - 192.168.19.250.

Am I using lnxrouter wrong, do I have to configure something beforehand or is this a bug? Thanks very much for any help.

Bandwidth limitations?

Are there limitations on the bandwidth for bridged connections?

How to reproduce:
On my Pi I have two WiFi adaptors, both supporting AP. Wlan0 and Wlan1 respectively.
One adaptor is used to connect to an available access point that supplies internet. The second adaptor is used to create the access point on the Pi which I can connect to with other devices. Which one is used does not appear to make a difference.

So by default the connection is shared across adaptors. The problem however is that it appears that the connection speed when bridged hovers around the 10mbps range.

Tests ive done:
Ive used multiple different WiFi adapters, in different combination. With the same outcome of 10mbps. (Adaptors with greater output power. Some with multiple Tx and Rx antennas)
Ive connected one devices at a time with the same outcome.
Ive connected about 10 devices all with the same outcome simultaneously.
Ive downloaded the speed test cli client and tested all the adaptors I have. Connected them to an available access point and tested the speed coming into the Pi. All the adaptors perform at 100% the speed of my ISP supplied connection.

So basically the problem is when broadcasting the connection across another WiFi adaptor, it appears to be reduced in the range of 70% - 80%. Is this expected in such a setup? Is there some kind of throttling implemented somewhere?

#1 This issue also mentions something about the speed.

Thanks in advance

dnsmasq can't read config file

After do full-system upgrade in Arch manjaro the script stopped to work

Starting dnsmasq

dnsmasq: cannot read /dev/shm/lnxrouter_tmp/lnxrouter.enp7s0.conf.zZqGYp/dnsmasq.conf: Permission denied

tried to disable apparmor with no luck

Feature request Wireguard Gateway

Hello i would like the funktion that use wireguard as a VPN gateway that all the traffic trouh a tunnel from the linux router to the wireguard server.

What do you mean it is possible to integrate?

Merry Chtistmas

Unable to create wifi-hotspot as adapter does not support AP (master) mode

this was the tool i was using....
sudo lnxrouter --ap wlo1 MyAccessPoint -p MyPassPhrase
ERROR: Your adapter does not support AP (master) mode

the output of iw list also clearly states that this does not support AP mode but on windows I am able to create wifi-hotspot.
so is there any way I can achieve this on linux, do I need to install some special dependency or different version of particular dependency?

wifi hotspot

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 !

Raspberry Pi 3B AP without internet + Android 10 Phone

Hi,

i'm trying to achieve something with my Raspberry Pi 3B and an Android phone. Unfortunately I'm stuck. I think the real problem is the Android 10's routing, because the AP that I create on my Raspberry works with a laptop. Anyway I try to summarize what I've learned about the problem, and maybe you might come up with a solution/workaround.

First, I have a WiFi OBD (on board diagnostic) that creates a network.

  gateway: 192.168.0.10, subnet 255.255.255.0
  dns: 192.168.0.10

ip route show (on my phone)

192.168.0.0/24 dev wlan0 proto kernel scope link src 192.168.0.19

If I connect to this network with my phone, I must turn off the mobil data first, then I can ping 192.168.0.10 and I also able to communicate with the obd interface. Unfortunately If I connect more devices, the devices can't ping each other just the gateway. So my idea: raspberry connects to the Wifi_OBDII network and simultaneously creates an AP. My service on pi can communicate with the obd interface, and my phone can communicate with the pi. The phone doesn't need to access the obd interface.

More info on WiFi_OBDII (from my laptop)

Nmap scan report for 192.168.0.10
Host is up (0.018s latency).
Not shown: 999 filtered ports
PORT      STATE SERVICE
30000/tcp open  ndmps

$ip a
3: wlp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 34:f3:9a:a3:ee:36 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.20/24 brd 192.168.0.255 scope global dynamic noprefixroute wlp1s0
       valid_lft 86343sec preferred_lft 75543sec
    inet6 fe80::36f3:9aff:fea3:ee36/64 scope link 
       valid_lft forever preferred_lft forever

$ip route show
default via 192.168.0.10 dev wlp1s0 proto dhcp src 192.168.0.20 metric 303 
192.168.0.0/24 dev wlp1s0 proto dhcp scope link src 192.168.0.20 metric 303

Details about how I tried to use linux-router.

./lnxrouter -n --ap wlan0_ap TomiMetria --hostname tomimetria -g 192.168.27.10
WARN: brmfmac driver doesn't work properly with virtual interfaces and
      it can cause kernel panic. For this reason we disallow virtual
      interfaces for your adapter.
      For more info: https://github.com/oblique/create_ap/issues/203
WARN: Your adapter does not fully support AP virtual interface, enabling --no-virt
PID: 2858
Target interface is wlan0_ap
WARN: Wifi is not protected by password
haveged_watchdog PID: 2895

Starting hostapd
hostapd PID: 2898
Configuration file: /dev/shm/lnxrouter_tmp/lnxrouter.wlan0_ap.conf.Ecl/hostapd.conf
wlan0_ap: Could not connect to kernel driver
Using interface wlan0_ap with hwaddr b8:27:eb:fb:8e:2c and ssid "TomiMetria"
wlan0_ap: interface state UNINITIALIZED->ENABLED
wlan0_ap: AP-ENABLED 
No Internet sharing

iptables: allow DNS port access
ACCEPT  tcp opt -- in wlan0_ap out *  192.168.27.0/24  -> 192.168.27.10   tcp dpt:53 /* lnxrouter-2858-wlan0_ap */
ACCEPT  udp opt -- in wlan0_ap out *  192.168.27.0/24  -> 192.168.27.10   udp dpt:53 /* lnxrouter-2858-wlan0_ap */

iptables: allow DHCP port access
ACCEPT  udp opt -- in wlan0_ap out *  0.0.0.0/0  -> 0.0.0.0/0   udp dpt:67 /* lnxrouter-2858-wlan0_ap */

Starting dnsmasq
Mar 29 16:05:24 dnsmasq[2936]: started, version 2.80 cachesize 150
Mar 29 16:05:24 dnsmasq[2936]: compile time options: IPv6 GNU-getopt DBus i18n IDN2 DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify dumpfile
Mar 29 16:05:24 dnsmasq[2936]: warning: no upstream servers configured
Mar 29 16:05:24 dnsmasq-dhcp[2936]: DHCP, IP range 192.168.27.10 -- 192.168.27.250, lease time 1h
Mar 29 16:05:24 dnsmasq-dhcp[2936]: DHCP, sockets bound exclusively to interface wlan0_ap
Mar 29 16:05:24 dnsmasq[2936]: cleared cache
dnsmasq PID: 2936

== Setting up completed, now linux-router is working ==
wlan0_ap: STA a0:28:ed:85:00:33 IEEE 802.11: associated
wlan0_ap: AP-STA-CONNECTED a0:28:ed:85:00:33
wlan0_ap: STA a0:28:ed:85:00:33 RADIUS: starting accounting session 2FD2F153B87501C5
Mar 29 16:06:14 dnsmasq-dhcp[2936]: DHCPDISCOVER(wlan0_ap) a0:28:ed:85:00:33 
Mar 29 16:06:14 dnsmasq-dhcp[2936]: DHCPOFFER(wlan0_ap) 192.168.27.204 a0:28:ed:85:00:33 
Mar 29 16:06:14 dnsmasq-dhcp[2936]: DHCPREQUEST(wlan0_ap) 192.168.27.204 a0:28:ed:85:00:33 
Mar 29 16:06:14 dnsmasq-dhcp[2936]: DHCPACK(wlan0_ap) 192.168.27.204 a0:28:ed:85:00:33 
wlan0_ap: STA 00:28:f8:4b:af:dc IEEE 802.11: associated
wlan0_ap: AP-STA-CONNECTED 00:28:f8:4b:af:dc
wlan0_ap: STA 00:28:f8:4b:af:dc RADIUS: starting accounting session 41CE24EFC36B8576
Mar 29 16:18:37 dnsmasq-dhcp[2936]: DHCPDISCOVER(wlan0_ap) 00:28:f8:4b:af:dc 
Mar 29 16:18:37 dnsmasq-dhcp[2936]: DHCPOFFER(wlan0_ap) 192.168.27.181 00:28:f8:4b:af:dc 
Mar 29 16:18:37 dnsmasq-dhcp[2936]: DHCPREQUEST(wlan0_ap) 192.168.27.181 00:28:f8:4b:af:dc 
Mar 29 16:18:37 dnsmasq-dhcp[2936]: DHCPACK(wlan0_ap) 192.168.27.181 00:28:f8:4b:af:dc tomi-pc

[root@alarmpi linux-router]# ./lnxrouter  --list-clients wlan0_ap
MAC                  IP                 Hostname
00:28:f8:4b:af:dc    192.168.27.181     tomi-pc
a0:28:ed:85:00:33    192.168.27.204     LICENSE

192.168.27.204 is my phone. 192.168.27.181 is a laptop. The laptop works, I mean from the laptop I can ping 192.168.27.10 the gateway.

[root@alarmpi linux-router]# arp -a
? (192.168.27.204) at a0:28:ed:85:00:33 [ether] on wlan0_ap
_gateway (192.168.1.1) at 48:f8:b3:14:89:e6 [ether] on wlan0
? (192.168.27.181) at 00:28:f8:4b:af:dc [ether] on wlan0_ap
? (192.168.1.102) at 34:f3:9a:a3:ee:36 [ether] on wlan0

I can ping the phone from the pi

[root@alarmpi linux-router]# ping 192.168.27.204
PING 192.168.27.204 (192.168.27.204) 56(84) bytes of data.
64 bytes from 192.168.27.204: icmp_seq=6 ttl=64 time=50.6 ms

I can ping the phone from the connected laptop as well.

But I can't ping the gateway from the phone.

phone details

$ ip route show
192.168.27.0/24 dev wlan0 proto kernel scope link src 192.168.27.204

I can ping the connected laptop from the phone, but I can't ping that damned gateway.

This is how I created the wlan0_ap on the pi.

$ iw dev wlan0 interface add wlan0_ap type __ap
$ macchanger -e wlan0_ap

[root@alarmpi linux-router]# iw wlan0_ap info
Interface wlan0_ap
	ifindex 4
	wdev 0x2
	addr b8:27:eb:fb:8e:2c
	ssid TomiMetria
	type AP
	wiphy 0
	channel 1 (2412 MHz), width: 20 MHz, center1: 2412 MHz
	txpower 31.00 dBm

[root@alarmpi linux-router]# iw wlan0 info
Interface wlan0
	ifindex 3
	wdev 0x1
	addr b8:27:eb:16:1b:4c
	ssid LinkSYS
	type managed
	wiphy 0
	channel 1 (2412 MHz), width: 20 MHz, center1: 2412 MHz
	txpower 31.00 dBm

Anyway, since the WiFi_OBDII creates a network where the gateway is accessible from my android phone, there must be a way to achieve this, isn't it?

I use archlinux on the raspberry.

Update: pinging the gateway from the laptop is working sometimes, but sometimes is not. Pinging the phone from the laptop works, but the time varies 20-400 ms.

Idea 2: hotspot on my phone. And connect the pi to two network simultaneously, but can't do that either.

[root@alarmpi alarm]# iw dev wlan0 interface add wlan2 type managed
command failed: Device or resource busy (-16)

Maybe I should get an usb wifi adapter for the pi to have 2 separate interface.

Does not appear to function with easytether.

First, thanks for your time.

I have been trying to get my phone tethered to Ubuntu 22.04, and then have that laptop broadcast a wifi network for my other devices to connect to. I use EasyTether (https://www.google.com/search?channel=fs&client=ubuntu-sn&q=easytether) to bypass bandwidth restrictions from my cell phone. With EasyTether connected I tried several different methods of creating a hotspot, such as using the built-in feature, as well as linuxwifihotspot (https://github.com/lakinduakash/linux-wifi-hotspot/blob/master/src/scripts/README.md).

In every case the AP was created, devices could successfully join, but none of them were able to obtain internet access.

This led to me finding linux-router when I was at my wit's end, so I installed all the dependencies and got the program to run successfully, but once again with the same result. Successful creation of a network that does not provide Internet access to its clients. Output of the program below. Just hoping that someone might have some insight as to why that internet traffic doesn't appear to successfully make it to the devices on the access point.

OUTPUT
sudo ./lnxrouter --ap wlo1 PfeffyTest -p Derp12345! --no-virt
linux-router 0.6.7 (https://github.com/garywill/linux-router)
Released under LGPL, with no warranty. Use on your own risk.

PID: 8963
Target interface is wlo1 (58:96:1d:ab:5f:27) PCI: 0000:00:14.3 Network controller [0280]: Intel Corporation Comet Lake PCH CNVi WiFi [8086:06f0]
Use random LAN IPv4 address 192.168.11.1
Set wlo1 unmanaged by NetworkManager

haveged_watchdog PID: 9086

Starting hostapd
hostapd PID: 9092
wlo1: interface state UNINITIALIZED->ENABLED
wlo1: AP-ENABLED

iptables v1.8.7 (nf_tables)
NOTICE: Not showing all operations done to iptables rules

iptables: NAT
MASQUERADE all opt -- in * out !wlo1 192.168.11.0/24 !-> 192.168.11.0/24 /* lrt8963wlo1 /
ACCEPT all opt -- in wlo1 out * 192.168.11.0/24 -> 0.0.0.0/0 /
lrt8963wlo1 /
ACCEPT all opt -- in * out wlo1 0.0.0.0/0 -> 192.168.11.0/24 /
lrt8963wlo1 */
Loaded kernel module nf_nat_pptp

iptables: allow DNS
ACCEPT tcp opt -- in wlo1 out * 192.168.11.0/24 -> 192.168.11.1 tcp dpt:53 /* lrt8963wlo1 /
ACCEPT udp opt -- in wlo1 out * 192.168.11.0/24 -> 192.168.11.1 udp dpt:53 /
lrt8963wlo1 */

iptables: allow dhcp
ACCEPT udp opt -- in wlo1 out * 0.0.0.0/0 -> 0.0.0.0/0 udp dpt:67 /* lrt8963wlo1 */

Starting dnsmasq
Apr 6 11:23:52 dnsmasq[9129]: started, version 2.86 cachesize 150
Apr 6 11:23:52 dnsmasq[9129]: compile time options: IPv6 GNU-getopt DBus no-UBus i18n IDN2 DHCP DHCPv6 no-Lua TFTP conntrack ipset auth cryptohash DNSSEC loop-detect inotify dumpfile
Apr 6 11:23:52 dnsmasq-dhcp[9129]: DHCP, IP range 192.168.11.10 -- 192.168.11.250, lease time 1h
Apr 6 11:23:52 dnsmasq-dhcp[9129]: DHCP, sockets bound exclusively to interface wlo1
Apr 6 11:23:52 dnsmasq[9129]: reading /etc/resolv.conf
Apr 6 11:23:52 dnsmasq[9129]: using nameserver 127.0.0.53#53
Apr 6 11:23:52 dnsmasq[9129]: cleared cache
dnsmasq PID: 9129

== Setting up completed, now linux-router should be working ==
wlo1: STA 14:13:33:ff:cb:a3 IEEE 802.11: authenticated
wlo1: STA 14:13:33:ff:cb:a3 IEEE 802.11: associated (aid 1)
wlo1: AP-STA-CONNECTED 14:13:33:ff:cb:a3
wlo1: STA 14:13:33:ff:cb:a3 RADIUS: starting accounting session 17A53CA186E731D6
wlo1: STA 14:13:33:ff:cb:a3 WPA: pairwise key handshake completed (RSN)
wlo1: EAPOL-4WAY-HS-COMPLETED 14:13:33:ff:cb:a3
Apr 6 11:24:41 dnsmasq-dhcp[9129]: DHCPDISCOVER(wlo1) 14:13:33:ff:cb:a3
Apr 6 11:24:41 dnsmasq-dhcp[9129]: DHCPOFFER(wlo1) 192.168.11.204 14:13:33:ff:cb:a3
Apr 6 11:24:41 dnsmasq-dhcp[9129]: DHCPDISCOVER(wlo1) 14:13:33:ff:cb:a3
Apr 6 11:24:41 dnsmasq-dhcp[9129]: DHCPOFFER(wlo1) 192.168.11.204 14:13:33:ff:cb:a3
Apr 6 11:24:42 dnsmasq-dhcp[9129]: DHCPREQUEST(wlo1) 192.168.11.204 14:13:33:ff:cb:a3
Apr 6 11:24:42 dnsmasq-dhcp[9129]: DHCPACK(wlo1) 192.168.11.204 14:13:33:ff:cb:a3 steamdeck
^Cwlo1: interface state ENABLED->DISABLED
wlo1: AP-STA-DISCONNECTED 14:13:33:ff:cb:a3
wlo1: AP-DISABLED
wlo1: CTRL-EVENT-TERMINATING

Doing cleanup..
nl80211: deinit ifname=wlo1 disabled_11b_rates=0
Apr 6 11:34:57 dnsmasq[9129]: exiting on receipt of SIGTERM
Killed dnsmasq.pid 9129 dnsmasq
Failed to kill haveged_watchdog.pid 9086 , it may have exited
Killed keep_running.pid 9154 bash
Undoing iptables changes ..
Restore wlo1 managed by NetworkManager
Exiting: This is the only running instance
Cleaning up done

[Support] No AP created

I am trying to create an AP on a rpi3b. It worked once, and I don't understand why it does not anymore.

I am using a command like:

 lnxrouter --ap wlan0 myAP -p thepassphrase -w 2 -c 8 --country FR --isolate-clients --random-mac  --no-virt

lnxrouter stops after settings the random mac.

I can test the same command on another rpi3b (+), and this works fine.

I have uninstalled haveged, because it was not installed on the one where it works, but that makes no difference.

I have no clue what is wrong. I wokrs with create_ap

WiFi Hotspot is okay, but how to make a wireless router?

I've been successfully using your command to make wireless hotspots, first with my low spec hp "desktop" (basically a laptop motherboard stuffed in an empty desktop case powered by a laptop power supply) Puppy Linux/Ubuntu machine, and now running on a headless Raspberry Pi 3B+ running Raspberry OS lite.
I moved the desktop to a different room and could not reliably connect wirelessly to the hotspot. I believe the desktop's onboard network card is flakey, at least in the 2.4 GHz band. Not wanting to run a cable I decided to connect by using an old Linksys WRT54g router running dd-wrt in Client Mode, basically as a glorified wireless card.
After many failed attempts, it occurred to me that the wireless hotspot is an access point but probably not a router and Client Mode is for router to router.
So, (sorry for the long-windedness) how do I setup a wireless router using your command? I tried:

sudo /home/linux-router-master/lnxrouter -i wlan0 <my ssid> -p <my password> -o eth0 &

in my /etc/rc.local but no dice (obviously!).
Is it possible through your command or do I need to power-up my CLI-fu?
I want :
Internet --- cable modem ---(eth0) --- RPi3+ --- (wlan0) router -- dd-wrt router in Client Mode -- (eth1?) -- desktop client

(There are other wireless clients on the wlan0 router but I couldn't figure out the linefeed tab whitespaces :( !! )

Thanks.

Run as service? (Also speed performance issue)

Hello, thank you for your job.
I tried running this (on Raspberry 3, with 2 external usb dongles), as well as the original create_ap and just like the original script, it seems to have an issue, with the interfaces, if run from crontab.
Any chance to run it as a service, so it will be much easier, to run it at start up?
Also both the script seem to have an issue, with wlan0 -> wlan1 relay. The speed is cut drastically, best I can get is 50% less download rate on wlan1, compared to wlan0. The upload speed seems unaffected that much.
I know the hardware can perform a lot better, since running the LEDE, on the set up, only has around 10% downgrade.
For additional information, on-board wifi disabled, as well as network-manager is off. Clean install of debian.

Thanks again.

No Broadcasting from a Non Internet Local AP

lnxrouter hangs at "lnxrouter setup complete" and I cannot see the ssid on any device... I'm not sure what information to include other than I'm using a Raspberry Pi Zero W running Raspbain Lite... Any help is appreciated.

Syntax error: "(" unexpected (expecting "}")

Hi,

Downloaded the file and tried to run it, but keep getting this error:

610: Syntax error: "(" unexpected (expecting "}")

is_5ghz_frequency() { [[ $1 =~ ^(49[0-9]{2})|(5[0-9]{3})$ ]] }

I can't see anything wrong here, but might just be me?

Operating system:
Kali Linux

Script fails without ipv6

I tried running this on a Puppy Linux distro with:
sudo lnxrouter -i <my eth interface>

and it fails while backing up settings with
ERROR: Failed backing up interface ipv6 bits

There's no /proc/sys/net/ipv6 directory on this system. I don't see an option to disable ipv6 in the script, only to enable it.
Any way of getting this to work?

Your adapter can not transmit to channel 36, frequency band 5GHz.

Hi! I found this tool while looking for a solution to create an access point with my AX200 PCIe card.
I'm looking to connect my Quest 2 VR headset (which supports WiFi 6) directly to my computer with as little latency as possible, and no access to the external internet. My understanding is that a 5GHz hotspot should provide this, so I ran the following command:

$ sudo lnxrouter -n --ap wlan0 MyAccessPoint -p passphrase --freq-band 5
linux-router 0.6.6 (https://github.com/garywill/linux-router)
Released under LGPL, with no warranty. Use on your own risk.

PID: 19700
Target interface is wlan0 (92:b6:95:3b:19:81)
Use random LAN IPv4 address 192.168.53.1
Creating a virtual WiFi interface... 
x0wlan0 created
Error occured

ERROR: Your adapter can not transmit to channel 36, frequency band 5GHz.



Doing cleanup.. 
Undoing iptables changes ..
bash: /dev/shm/lnxrouter_tmp/lnxrouter.wlan0.conf.rGInnm/undo_iptables.sh: No such file or directory
Exiting: This is the only running instance
Killing PGID 19699 ...
Cleaning up done

I had the same issue trying to use linux-wifi-hotspot, so I think it's an issue with create_ap, but it seems it is now unmaintained.
Is there anything I can try? The 2.4GHz hotspot gives me 58Mbps, which is not what the AX200 card I bought advertises.

I've attached the output of a few other commands:

$ lspci | grep AX200
03:00.0 Network controller: Intel Corporation Wi-Fi 6 AX200 (rev 1a)

$ iw dev
phy#0
        Interface wlan0
                ifindex 3
                wdev 0x1
                addr 44:af:28:36:70:72
                type managed
                txpower 0.00 dBm
                multicast TXQ:
                        qsz-byt qsz-pkt flows   drops   marks   overlmt hashcol tx-bytes        tx-packets
                        0       0       0       0       0       0       0       0               0

iw_list.txt

Can't change the network ip address

I'm trying to set a custom network address, but unfortunately it never changes.

I'm running the access point using this command:
sudo ./lnxrouter --ap ap@wlan0 MyAccessPoint -p MyPassPhrase -g 10.10.10.10

When I look at my ip address, I have this:

4: ap@wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether e4:5f:01:5c:51:af brd ff:ff:ff:ff:ff:ff
    inet 192.168.4.1/24 brd 192.168.4.255 scope global ap@wlan0
       valid_lft forever preferred_lft forever
    inet 10.10.10.10/24 brd 10.10.10.255 scope global ap@wlan0
       valid_lft forever preferred_lft forever

The first one never changes, regardless of what I give in -g or even if i set -g.

I can ping 10.10.10.10 from the host itself, but not from a connected client.

Concerning the clients, they got an a dress in 192.168.4.0 too:

3: wlp59s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether a8:7e:ea:30:ad:09 brd ff:ff:ff:ff:ff:ff
    inet 192.168.4.49/24 brd 192.168.4.255 scope global dynamic noprefixroute wlp59s0
       valid_lft 3597sec preferred_lft 3597sec
    inet6 fe80::30ce:702d:cbdf:a5cb/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

help

 Hello! I have a problem ((I’m trying to make a router from rpi zero w, I set up the connection in this way: the Internet takes over wifi (wlan0) and gives it to the computer over ethernet-usb (usb0). everything works smoothly.

cat /etc/iptables/rules.v4

Generated by xtables-save v1.8.2 on Sat Aug 17 20:50:44 2019

*filter
:INPUT ACCEPT [462:36090]
:FORWARD ACCEPT [263:144982]
:OUTPUT ACCEPT [450:57803]
-A FORWARD -i usb0 -o local-network -j ACCEPT
COMMIT

Completed on Sat Aug 17 20:50:44 2019

Generated by xtables-save v1.8.2 on Sat Aug 17 20:50:44 2019

*nat
:PREROUTING ACCEPT [42:4401]
:INPUT ACCEPT [20:2013]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [76:5665]
-A PREROUTING -i usb0 -p tcp -m tcp --dport 22 -j REDIRECT --to-ports 22
-A PREROUTING -i usb0 -p udp -m udp --dport 53 -j REDIRECT --to-ports 53
-A POSTROUTING -j MASQUERADE
-A POSTROUTING -s 10.1.1.0/24 ! -d 10.1.1.0/24 -j MASQUERADE
COMMIT

Completed on Sat Aug 17 20:50:44 2019

also works with this iptables:

Generated by xtables-save v1.8.2 on Sun Aug 18 16:29:53 2019

*filter
:INPUT ACCEPT [895:80551]
:FORWARD ACCEPT [5085:1730477]
:OUTPUT ACCEPT [766:85758]
COMMIT

Completed on Sun Aug 18 16:29:53 2019

Generated by xtables-save v1.8.2 on Sun Aug 18 16:29:53 2019

*nat
:PREROUTING ACCEPT [165:12567]
:INPUT ACCEPT [152:11771]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [147:9966]
-A POSTROUTING -o wlan0 -j MASQUERADE
COMMIT

Completed on Sun Aug 18 16:29:53 2019

ifconfig

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Local Loopback)
RX packets 15 bytes 9210 (8.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 15 bytes 9210 (8.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.1.1.1 netmask 255.255.255.0 broadcast 10.1.1.255
inet6 fe80::25c:a702:1a70:ac6c prefixlen 64 scopeid 0x20
ether fe:4d:37:95:9b:60 txqueuelen 1000 (Ethernet)
RX packets 333 bytes 38248 (37.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 288 bytes 82047 (80.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.10.10.157 netmask 255.255.255.0 broadcast 10.10.10.255
inet6 fe80::f94b:dcf:b227:5f43 prefixlen 64 scopeid 0x20
ether b8:27:eb:b9:a3:4f txqueuelen 1000 (Ethernet)
RX packets 206 bytes 65212 (63.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 226 bytes 38265 (37.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lnxrouter -i usb0 works right! (iptables -F && iptables -t nat -F && systemctl stop dnsmasq && lnxrouter -i usb0)

but i need transparent proxy (SOCKS5 и SSH) and when i run:
iptables -F && iptables -t nat -F && systemctl stop dnsmasq && ssh -fND 5555 [email protected] && lnxrouter -i usb0 --tp 5555 --dns 1.1.1.1:853) there is no inet((((

I also tried pr0cks, followed all the instructions, but the Internet is the same as it was, but if you run curl ifconfig.me on rpi (connecting via ssh), then the Internet is proxied inside it ... I’ve been suffering for half a year !! ! please help !!!! (((((from me 'coffee' as you say))

mktemp: Invalid argument

Hi, im using Alpine Linux 3.12 with BusyBox 1.31.1 and mktemp fails with mktemp: Invalid argument.
I had to change line 1238 to CONFDIR="$(mktemp -d $TMPDIR/lnxrouter.${TARGET_IFACE}.conf.XXXXXX)".

mktemp requires 6 times X for the file/dir template.

Awesome script, best regards.

Error Device or resource busy

an error occurred while bringing the virtual interface up
command:

sudo ./lnxrouter --ap wlp0s20f3 victorAP -p 12345678

output:

PID: 213324
Target interface is wlp0s20f3
Use random LAN IPv4 address 192.168.238.1
Creating a virtual WiFi interface... 
x0wlp0s20f3 created)
Set x0wlp0s20f3 unmanaged by NetworkManager
Assigning MAC address 5e:a8:4c:ab:73:5a to virtual interface x0wlp0s20f3 according to wlp0s20f3 ...
RTNETLINK answers: Device or resource busy
Error occured

ERROR: Failed bringing x0wlp0s20f3 up



Doing cleanup.. 
iptables: stop NAT
iptables: unallow DNS
iptables: unallow dhcp
Exiting: This is the only running instance
Cleaning up done

Network traffic is forwarded to tor, but onion network services don't work!

Network traffic is forwarded to tor perfectly using the following command: ./lnxrouter --ap interface SSID -p PASSWORD --tp 9040 --dns 9053 but onion network services, that is, .onion sites do not open no way. Could you fix this? I use your script specifically for this purpose and I think this functionality is extremely important.

I get the following error when accessing onion network sites, my tor gives me this as output whenever I send a request to .onion services: error: [warn] Onion address [scrubbed] requested from a port with .onion disabled

Sincerely: Jonas.

Syntax error line number #662

sudo lnxrouter --ap wlan0 MyAccessPoint -p MyPassPhrase

I got "syntax error" :

/usr/bin/lnxrouter: 622: /usr/bin/lnxrouter: Syntax error: "(" unexpected (expecting "}")

FYI:

OS: Debian Linux
Wifi availability : Laptop attached Wifi
I changed the wifi access point by using the command sudo iwconfig

Ref:


is_5ghz_frequency() {
    [[ $1 =~ ^(49[0-9]{2})|(5[0-9]{3})$ ]]
}

dnsmasq: unknown user or group nobody

I am experiencing above error when using
lnxrouter -i eth0

on my Raspberry Pi 2B with raspbx 14 (stretch). The lnxrouter script cancels itself by consequence.
Any help would be appreciated. Thanks!

Feature request: Web interface

Can you make interface for simple using? Maybe connected clients listing, manage instances, edit interfaces which be WAN and LAN on startup.

Wifi hotspot without internet

Hi,

I am trying to create a wifi hotspot, that works without internet connection and still I would be able to ssh to it from another computer. At the moment it is connected to another router and the hotspot is working as expected, but when there is no internet the SSH is not working.

Many thanks!!

Hi, i loved this project, is super simple to use, i used my laptop as router with an ethernet switcher, now i dont have to buy a new router!! thanks!!

iptables: No chain/target/match by that name.

linux-router 0.6.6 (https://github.com/garywill/linux-router)
Released under LGPL, with no warranty. Use on your own risk.

PID: 4527
Target interface is wlan0 (08:e9:f6:5b:d0:4a)
Use random LAN IPv4 address 192.168.168.1
wlan0 already in channel 157 (5785 MHz)
Channel fallback to 157
Creating a virtual WiFi interface...
x0wlan0 created
Set x0wlan0 unmanaged by NetworkManager
Assigning MAC address 08:e9:f6:5b:d0:54 to virtual interface x0wlan0 according to wlan0 ...

haveged_watchdog PID: 4705

Starting hostapd
hostapd PID: 4710
Configuration file: /dev/shm/lnxrouter_tmp/lnxrouter.wlan0.conf.Su2GtA/hostapd.conf
Using interface x0wlan0 with hwaddr 08:e9:f6:5b:d0:54 and ssid "epcom"
x0wlan0: interface state UNINITIALIZED->ENABLED
x0wlan0: AP-ENABLED

iptables v1.6.1
NOTICE: Not showing all operations done to iptables rules

iptables: NAT
*### MASQUERADE all opt -- in * out !x0wlan0 192.168.168.0/24 !-> 192.168.168.0/24 /* lrt4527x0wlan0 /
iptables: No chain/target/match by that name.
Error occured

Doing cleanup..
./lnxrouter: line 755: 4735 Terminated sleep 2
Killed haveged_watchdog.pid 4705 lnxrouter
x0wlan0: interface state ENABLED->DISABLED
x0wlan0: AP-DISABLED
nl80211: deinit ifname=x0wlan0 disabled_11b_rates=0
Killed hostapd.pid 4710 hostapd
Undoing iptables changes ..
iptables: No chain/target/match by that name.
Exiting: This is the only running instance
Cleaning up done
hdxt@Mate-HDXT:~/linux-router$ Error occured

ERROR: hostapd failed

./lnxrouter: line 1215: kill: (4527) - No such process

Doing cleanup..
Undoing iptables changes ..
Exiting: This is the only running instance
Cleaning up done

ERROR: Your adapter does not support AP (master) mode

How to resolve this, dual wifi and hotspot works fine on windows

*-network
description: Wireless interface
product: Realtek Semiconductor Co., Ltd.
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:03:00.0
logical name: wlo1
version: 00
serial: f8:89:d2:e6:d8:c3
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=rtw89_pci driverversion=5.13.0-41-generic firmware=N/A ip=192.168.48.212 latency=0 link=yes multicast=yes wireless=IEEE 802.11
resources: irq:80 ioport:d000(size=256) memory:fc800000-fc8fffff

02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 16)

I am using rtw89 pci drivers

Stuck on Obtaining IP address (firewalld)

I'm using fedora 34 currently, and even after all the dependencies are installed (iproute2 is iproute here but they're basically the same) and the access point is created, see below

lnxrouter --ap wlp3s0 MyAccessPoint -p MyPassPhrase
PID: 5919
Target interface is wlp3s0 (e0:ca:94:8b:53:4f)
Use random LAN IPv4 address 192.168.53.1
wlp3s0 already in channel 11 (2462 MHz)
Channel fallback to 11
Creating a virtual WiFi interface... 
x0wlp3s0 created
Set x0wlp3s0 unmanaged by NetworkManager
Assigning MAC address e0:ca:94:8b:53:59 to virtual interface x0wlp3s0 according to wlp3s0 ...
haveged_watchdog PID: 6045

Starting hostapd
hostapd PID: 6048
Configuration file: /dev/shm/lnxrouter_tmp/lnxrouter.wlp3s0.conf.W74/hostapd.conf
Using interface x0wlp3s0 with hwaddr e0:ca:94:8b:53:59 and ssid "MyAccessPoint"
x0wlp3s0: interface state UNINITIALIZED->ENABLED
x0wlp3s0: AP-ENABLED 

iptables: NAT 
MASQUERADE  all opt -- in * out !x0wlp3s0  192.168.53.0/24 !-> 192.168.53.0/24  
ACCEPT  all opt -- in x0wlp3s0 out *  192.168.53.0/24  -> 0.0.0.0/0  
ACCEPT  all opt -- in * out x0wlp3s0  0.0.0.0/0  -> 192.168.53.0/24  
Loaded kernel module nf_nat_pptp

iptables: allow DNS
ACCEPT  tcp opt -- in x0wlp3s0 out *  192.168.53.0/24  -> 192.168.53.1   tcp dpt:53
ACCEPT  udp opt -- in x0wlp3s0 out *  192.168.53.0/24  -> 192.168.53.1   udp dpt:53

iptables: allow dhcp
ACCEPT  udp opt -- in x0wlp3s0 out *  0.0.0.0/0  -> 0.0.0.0/0   udp dpt:67

Starting dnsmasq
Jun 14 12:55:30 dnsmasq[6076]: started, version 2.85 cachesize 150
Jun 14 12:55:30 dnsmasq[6076]: compile time options: IPv6 GNU-getopt DBus no-UBus no-i18n IDN2 DHCP DHCPv6 no-Lua TFTP no-conntrack ipset auth cryptohash DNSSEC loop-detect inotify dumpfile
Jun 14 12:55:30 dnsmasq-dhcp[6076]: DHCP, IP range 192.168.53.10 -- 192.168.53.250, lease time 1h
Jun 14 12:55:30 dnsmasq-dhcp[6076]: DHCP, sockets bound exclusively to interface x0wlp3s0
Jun 14 12:55:30 dnsmasq[6076]: reading /etc/resolv.conf
Jun 14 12:55:30 dnsmasq[6076]: using nameserver 127.0.0.53#53
Jun 14 12:55:30 dnsmasq[6076]: cleared cache
dnsmasq PID: 6076

== Setting up completed, now linux-router is working ==

when i'm trying to connect my phone to the newly made access point, it stuck in a loop between connecting and obtaining ip address. and after a while, it stops with "IP Configuration Failure". here is the output on the terminal while the reconnection is happening. (

x0wlp3s0: STA 2c:4d:54:a7:8c:22 IEEE 802.11: authenticated
x0wlp3s0: STA 2c:4d:54:a7:8c:22 IEEE 802.11: associated (aid 1)
x0wlp3s0: AP-STA-CONNECTED 2c:4d:54:a7:8c:22
x0wlp3s0: STA 2c:4d:54:a7:8c:22 RADIUS: starting accounting session 503193598255D4BF
x0wlp3s0: STA 2c:4d:54:a7:8c:22 WPA: pairwise key handshake completed (RSN)
x0wlp3s0: AP-STA-DISCONNECTED 2c:4d:54:a7:8c:22
x0wlp3s0: STA 2c:4d:54:a7:8c:22 IEEE 802.11: authenticated
x0wlp3s0: STA 2c:4d:54:a7:8c:22 IEEE 802.11: associated (aid 1)
x0wlp3s0: AP-STA-CONNECTED 2c:4d:54:a7:8c:22
x0wlp3s0: STA 2c:4d:54:a7:8c:22 RADIUS: starting accounting session 67324ADF103B09AB
x0wlp3s0: STA 2c:4d:54:a7:8c:22 WPA: pairwise key handshake completed (RSN)
x0wlp3s0: AP-STA-DISCONNECTED 2c:4d:54:a7:8c:22
x0wlp3s0: STA 2c:4d:54:a7:8c:22 IEEE 802.11: authenticated
x0wlp3s0: STA 2c:4d:54:a7:8c:22 IEEE 802.11: associated (aid 1)
x0wlp3s0: AP-STA-CONNECTED 2c:4d:54:a7:8c:22
x0wlp3s0: STA 2c:4d:54:a7:8c:22 RADIUS: starting accounting session 5C975DF981254FC3
x0wlp3s0: STA 2c:4d:54:a7:8c:22 WPA: pairwise key handshake completed (RSN)
x0wlp3s0: AP-STA-DISCONNECTED 2c:4d:54:a7:8c:22
x0wlp3s0: STA 2c:4d:54:a7:8c:22 IEEE 802.11: authenticated
x0wlp3s0: STA 2c:4d:54:a7:8c:22 IEEE 802.11: associated (aid 1)
x0wlp3s0: AP-STA-CONNECTED 2c:4d:54:a7:8c:22
x0wlp3s0: STA 2c:4d:54:a7:8c:22 RADIUS: starting accounting session 3447F6397B00AB6C
x0wlp3s0: STA 2c:4d:54:a7:8c:22 WPA: pairwise key handshake completed (RSN)
x0wlp3s0: AP-STA-DISCONNECTED 2c:4d:54:a7:8c:22
x0wlp3s0: STA 2c:4d:54:a7:8c:22 IEEE 802.11: authenticated
x0wlp3s0: STA 2c:4d:54:a7:8c:22 IEEE 802.11: associated (aid 1)
x0wlp3s0: AP-STA-CONNECTED 2c:4d:54:a7:8c:22
x0wlp3s0: STA 2c:4d:54:a7:8c:22 RADIUS: starting accounting session 49A83E82BB3A7A28
x0wlp3s0: STA 2c:4d:54:a7:8c:22 WPA: pairwise key handshake completed (RSN)
x0wlp3s0: AP-STA-DISCONNECTED 2c:4d:54:a7:8c:22

any thought regarding this behavior? I would love to see this issue to be fixed as soon as possible.

command failed: Invalid argument (-22)

On ubuntu, When trying to serve a hotspot on the same interface that has internet, the script is failing. sudo ./lnxrouter --ap <wireless interface with internet> hotspot -p password.

linux-router 0.6.6 (https://github.com/garywill/linux-router)
Released under LGPL, with no warranty. Use on your own risk.

PID: 216391
Target interface is <interface with internet> (a6:1a:58:36:f3:c9)   PCI: 
Use random LAN IPv4 address 192.168.99.1
<interface with internet> already in channel 6 (2437 MHz)
Channel fallback to 6
Creating a virtual WiFi interface... 
kernel reports: Attribute failed policy validation
command failed: Invalid argument (-22)
Error occured

ERROR: Failed creating virtual WiFi interface. Maybe your WiFi adapter does not fully support virtual interfaces. Try again with '--no-virt'

If I add --no-virt it works but no internet is served on the hotspot. I had no trouble doing this with the original create_ap script.

The problem is coming from this line.

I even tried manually running the command iw dev ...etc but it returns the same error:

kernel reports: Attribute failed policy validation
command failed: Invalid argument (-22)

In case it is related to this, the name of the interface I have with internet is 15 characters long, and the variable VWIFI_IFACE has a length of 17 characters.

Make DHCP Range Configureable [Feature Request]

Perhaps to utilize this more efficiently across all systems, we should enhance this to allow configuration inside of the command to launch lnxrouter as to provide DHCP range configuration, due to problems with some networks, the default will not work for me. I feel some others will also have the same problem.

I think --dhcp-range should work, allowing a /24 of xxx.xxx.xxx.xxx , this provide ability to layer as subnet next to the providing iface's (eth0) base range. Allowing microsoft to be have with this. iOS and MacOS seem fine but microsoft gets major packet loss and delays on connecting from time to time due to address assignments being abnormal for their shitty networking code in windows 10.

Just an idea, I will fork and modify myself, if you say yes to this, I will code in the functions for it happily.

Respect, R.N.

How to create 5G AP ?

My network card is 3168NGW.
$ lspci 02:00.0 Network controller: Intel Corporation Dual Band Wireless-AC 3168NGW [Stone Peak] (rev 10)
I know that it supports 5G.

I use lnxrouter --ap wlp2s0 HelloWIFI -p 12345678 to create AP.
But the wifi only support 2.4G.

addr_gen_mode no such file or directory

Currently when starting the access point, I get the following output.

linux-router 0.6.6 (https://github.com/garywill/linux-router)
Released under LGPL, with no warranty. Use on your own risk.

PID: 4714
Target interface is wlan0 (30:d8:c4:52:d8:91)
cp: cannot stat '/proc/sys/net/ipv6/conf/wlan0/addr_gen_mode': No such file or directory
Error occured

ERROR: Failed backing up interface ipv6 bits

Doing cleanup..
Undoing iptables changes ..
Exiting: This is the only running instance
Cleaning up done

Before this was working on Ubuntu 22, but now I have downgraded to 20.04 and receiving this issue. Any tips?

How to apply lnx router to make transparent proxy in proxmox?

hi, i want to make transparent proxy in proxmox, it's possible to use this script to create network card, and assign DHCP ip range to this network card, so that i can select VMBR1 for VM, to route all traffic truth proxy server. thanks, best regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.