I've got a machine with no physical access that I want to ssh into, I'm now using tor to do that but I would like to connect directly to improve latency and throughput. I had set up port forwarding while I had physical access to the router and machine but I hadn't changed the GatewayPorts in sshd_config, by the time I figured it out it changed IP addresses and I'm now trying to get static IP working.
I followed this guide from Gentoo's documentation and tried various things I found on the internet and the only thing I've been able to do is add another IP to the interface alongside the dhcp assigned one. If I stop the dhcp client and delete the dhcp address I lose connection to the server which makes me believe the reason I cannot connect to it directly is a misconfiguration on the static IP on the machine ( I have a script that if not killed, after 20min will reset my changes so I haven't lost connection to the machine yet ).
Here is the relevant output from ip addr
1: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether : : : : : brd ff:ff:ff:ff:ff:ff
altname enp2s0
inet 192.168.1.7/24 brd 192.168.1.255 scope global eno1
valid_lft forever preferred_lft forever
inet 192.168.1.6/24 brd 192.168.1.255 scope global secondary dynamic noprefixroute eno1
valid_lft 86397sec preferred_lft 75597sec
My /etc/conf.d/net has:
config_eno1="192.168.1.7/24"
routes_eno1="default via 192.168.1.1"
# The 8.8.8.8 is provided here to show that multiple DNS servers entries can be added for a single interface.
dns_servers_eno1="192.168.1.1 8.8.8.8"
#config_eno1="192.168.1.7 netmask 255.255.255.0"
#routes_eno1="default via 192.168.1.1"
#dns_servers_eno1="8.8.8.8"
I have tried both the current and the commented out way of doing it with neither of them seemingly working and I use rc-service net.eno1 restart
after editing the file
ip route
when it is on DHCP?ip route
is this . I did change the src ip to 192.168.1.7 and proto to static but still when I deleted the 192.168.1.6 dhcp assigned ip I lost connection to it.