Repository navigation
script reconfiguring local interface and cutting off local ssh #31
Description
Activity
I guess this is the network you're trying to make:
Internet ---[ wlan0 - router - eth0 ]----- computersAm I getting it right?
The current script
-i eth0will reset eth0.
To solve this, we need to implement an option to not reset in future version.BTW, currently can you reconnect to router via ssh after running the command and it resetting?
Before the fix is implemented, there's workaround.
Try comment out these:
Lines 2008 to 2032 in f6995bc
# initialize subnet interface # take subnet interface down first ip link set down dev ${SUBNET_IFACE} || die "Failed setting ${SUBNET_IFACE} down" # flush old IPs of subnet interface ip addr flush ${SUBNET_IFACE} || die "Failed flush ${SUBNET_IFACE} IP" dealwith_mac # setting MAC should be after setting NM unmanaged [[ $WIFI_IFACE ]] && check_rfkill_unblock_wifi # bring subnet interface up ip link set up dev ${SUBNET_IFACE} || die "Failed bringing ${SUBNET_IFACE} up" # hostapd , haveged [[ $WIFI_IFACE ]] && run_wifi_ap_processes # add ipv4 address to subnet interface ip -4 addr add ${GATEWAY}/24 broadcast ${GATEWAY%.*}.255 dev ${SUBNET_IFACE} || die "Failed setting ${SUBNET_IFACE} IPv4 address" set_ipv6_bits # add ipv6 address to subnet interface if [[ $IPV6 -eq 1 ]] ; then ip -6 addr add ${GATEWAY6}/64 dev ${SUBNET_IFACE} || die "Failed setting ${SUBNET_IFACE} IPv6 address" fi
Line 1162 in f6995bc
ip link set down dev ${SUBNET_IFACE}
Line 1158 in f6995bc
ip addr flush ${SUBNET_IFACE}
Line 1169 in f6995bc
restore_interface_status Then run
sudo lnxrouter -i eth0 -g 192.168.166.100(Notice this is a dirty workaround for your current use case only, not a true fix)
I haven't tested.hi and thanks for the quick response!
This is my actual setup.
Internet ---[ wlan0 - router (PiZero2) - usb0 ]----- just one computer - ethernet over USB
I have the feeling that the reset if killing the usb0 (gadget mode) and is not coming back at all...Ill check you temp fix.
Best
Tasos- addedbugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request
on Jan 13, 2022 This is what I got:
sudo ./lnxrouter -i usb0 -g 192.168.166.100 1 ⨯ linux-router 0.6.6 (https://github.com/garywill/linux-router) Released under LGPL, with no warranty. Use on your own risk. PID: 1075 Target interface is usb0 (3a:ea:66:54:bc:a2) RTNETLINK answers: File exists Error occured ERROR: Failed setting usb0 IPv4 address Doing cleanup.. Undoing iptables changes .. Exiting: This is the only running instance Cleaning up doneand:
sudo ./lnxrouter -i usb0 -o wlan0 -g 192.168.166.100 [sudo] password for kali: linux-router 0.6.6 (https://github.com/garywill/linux-router) Released under LGPL, with no warranty. Use on your own risk. PID: 991 Target interface is usb0 (3a:ea:66:54:bc:a2) RTNETLINK answers: File exists Error occured ERROR: Failed setting usb0 IPv4 address Doing cleanup.. Undoing iptables changes .. Exiting: This is the only running instance Cleaning up doneWith your edits above.
ThanksSorry for inconvinence. Try branch https://github.com/garywill/linux-router/tree/workaround-31
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 wlan0and:
sudo lnxrouter -i eth0 -o wlan0 -g 192.168.166.100Both killed my link to the 'router' from eth0.
Am I missing something?
Thanks