You are not logged in.

#1 2021-07-15 19:41:32

Morta
Member
Registered: 2019-07-07
Posts: 655

Connection lost after Laptop restart

I have a Laptop behind a Lenovo Thinkapd Dockingstation the Station is directly wired to the Server, when i restart the laptop i have every time to execute sudo bash /etc/rc.local. When i dosen't do it i want able to connect.

Which command could be that have this effect in this script ?

[morta@5erver ~]$ sudo cat /etc/rc.local
#!/bin/bash

sudo ip link set enp6s0 up
sudo ip address add 192.168.68.1/24 broadcast + dev enp6s0
su root -c 'sysctl net.ipv4.ip_forward=1'
sudo  cp /etc/resolv.conf /etc/resolv.conf.upstream
sudo  rm /etc/resolv.conf
sudo  echo "nameserver 127.0.0.1" > /etc/resolv.conf
sudo  echo "nameserver 8.8.8.8" > /etc/resolv.conf
iptables -t nat -A POSTROUTING -o enp2s0 -j MASQUERADE
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i enp6s0 -o enp2s0 -j ACCEPT
# Allow DHCP and DNS requests from LAN
iptables -A INPUT -p udp -i enp6s0 --dport 67 -j ACCEPT
iptables -A INPUT -p udp -i enp6s0 --dport 53 -j ACCEPT
iptables -A INPUT -p tcp -i enp6s0 --dport 53 -j ACCEPT
iptables -A INPUT -p tcp -i enp6s0 --dport 67 -j ACCEPT

It's a wonder. I don't get it....

Offline

#2 2021-07-16 10:54:19

seth
Member
Registered: 2012-09-03
Posts: 51,029

Re: Connection lost after Laptop restart

What "server" and if this is archlinux, why is there an rc.local to begin with - and since you don't understand what it does, how did it end up there?
The stuff sets up the network and a simple firewall (looks like this is a router?) in a wild mix of sudo, su and "i'm gonna assume to be root anyway"…

For archlinux, see https://wiki.archlinux.org/title/Network_configuration
For everything else: we don't know anything about that system so we can't tell you either.

Offline

Board footer

Powered by FluxBB