Fli
03-15-2021, 01:40 PM
This is any attempt:
A)
in router configuration, DHCP LAN client list, you may be able to make it remember current IP so it always use it (until you reset the router).
B)
right click the network conenction icon in the Linux menu bar (NetworkManager), Edit connections, Edit your main conenction, go to IPv4 tab, switch from DHCP to manual and set your desired LAN IP (if router is 192.168.0.1, then maybe 192.168.0.15) mask is 24, gateway is router IP, DNS is router IP and then after coma add maybe 1.1.1.1 (cloudflare's open dns IP). Disable/enable this connection in NetworkManager (NM).
C)
1. If you do not know your router address and you are connected to it, IP can be listed by "ip r|grep default"
2. Open current main network interface NetworkManager configuration file located in: /etc/NetworkManager/system-connections/:
Following may work to do it:
nic=$(ip -o -4 route show to default|head -n1|awk '{print $5}') && sudo nano /etc/NetworkManager/system-connections/"$nic".nmconnection||sudo vi /etc/NetworkManager/system-connections/"$nic".nmconnection
3. in [ipv4] section replace that section lines, mybe just 1 line: "method=auto" by something like following (using your LAN 192.168.x.x IPs):
address1=192.168.0.20/24,192.168.0.1
dns=192.168.0.1;1.1.1.1;8.8.8.8;
dns-search=
method=manual
4. run:
nmcli network off;nmcli network on;nmcli;echo -e "\nWaiting 10 seconds for the network interface to come up to ping to internet";sleep 10;ping -c 2 -w 2 1.1.1.1
if using VPN, restart it after done
A)
in router configuration, DHCP LAN client list, you may be able to make it remember current IP so it always use it (until you reset the router).
B)
right click the network conenction icon in the Linux menu bar (NetworkManager), Edit connections, Edit your main conenction, go to IPv4 tab, switch from DHCP to manual and set your desired LAN IP (if router is 192.168.0.1, then maybe 192.168.0.15) mask is 24, gateway is router IP, DNS is router IP and then after coma add maybe 1.1.1.1 (cloudflare's open dns IP). Disable/enable this connection in NetworkManager (NM).
C)
1. If you do not know your router address and you are connected to it, IP can be listed by "ip r|grep default"
2. Open current main network interface NetworkManager configuration file located in: /etc/NetworkManager/system-connections/:
Following may work to do it:
nic=$(ip -o -4 route show to default|head -n1|awk '{print $5}') && sudo nano /etc/NetworkManager/system-connections/"$nic".nmconnection||sudo vi /etc/NetworkManager/system-connections/"$nic".nmconnection
3. in [ipv4] section replace that section lines, mybe just 1 line: "method=auto" by something like following (using your LAN 192.168.x.x IPs):
address1=192.168.0.20/24,192.168.0.1
dns=192.168.0.1;1.1.1.1;8.8.8.8;
dns-search=
method=manual
4. run:
nmcli network off;nmcli network on;nmcli;echo -e "\nWaiting 10 seconds for the network interface to come up to ping to internet";sleep 10;ping -c 2 -w 2 1.1.1.1
if using VPN, restart it after done