0

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

2
  • If you're on a network controlled by DHCP, it might be easier to keep everything in one place by assigning the IP in the DHCP server's configuration. Many routers have a way to set a static or reserved IP on clients. If you still want to set it on the machine manually, maybe your route isn't correct. What's the output of ip route when it is on DHCP?
    – binki
    Commented Nov 3, 2022 at 23:32
  • @binki As far as i know I can't access the dhcp server settings, it's all in a web interface from the router and the closest I got was setting up an http proxy through a tor web server on this machine but it didn't work well enough to allow me to log in to the router's web ui. The out from 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. Commented Nov 4, 2022 at 15:10

0

You must log in to answer this question.

Browse other questions tagged .