You are not logged in.

#1 2021-12-22 16:57:05

1LKJHVC
Member
Registered: 2021-12-22
Posts: 3

Can not ssh from my arch desktop to my ubuntu notebook

Hello everyone, hope you are doing ok. I am complete newbie in networking, and I am trying to connect two computers via LAN. I use a switch to connect everything, so in the switch I have the internet cable, the cable to my arch desktop and the cable to my ubuntu notebook. So, the problem is:
I can not ssh from my arch desktop to my ubuntu notebook, but I can ssh from my ubuntu notebook to my arch desktop. They are connected via LAN, using a Ethernet cable. I followed an old thread here https://bbs.archlinux.org/viewtopic.php?id=179312 to achieve my current situation.

Specifically, I used this commands on my ubuntu notebook:

sudo ip addr add 192.168.1.2/24 dev enp2s0
sudo ip route add 192.168.1.0/24 dev enp2s0
sudo ufw allow ssh

And I used this command on my arch desktop:

sudo ip addr add 192.168.1.1/24 dev enp7s0
sudo nano /etc/ssh/sshd_config (to open my port 22, I just uncommented the line with the number 22)

When trying to ping my ubuntu notebook from the arch desktop  using "  ping 192.168.1.2 ", it always returns:

PING 192.168.1.2 (192.168.1.2) 56(84) bytes of data.
From 192.168.1.1 icmp_seq=1 Destination Host Unreachable

 
When trying to ssh into my ubuntu notebook  from the arch desktop using " ssh [USERNAME]@192.168.1.2 ", it returns:

 ssh: connect to host 192.168.1.2 port 22: No route to host

When trying to ping my arch desktop from the ubuntu notebook using "  ping 192.168.1.1 ", it succeed.
When trying to ssh into my arch desktop from the ubuntu notebook using " ssh [USERNAME]@192.168.1.1 ", it succeed.

Here is the output of "ifconfig", "ip route show" and "ip addr show" in my ubuntu notebook:

enp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.100.8  netmask 255.255.255.0  broadcast 192.168.100.255
        inet6 fe80::2935:29f7:51b4:b479  prefixlen 64  scopeid 0x20<link>
        inet6 2804:d45:b94f:3a00:60fe:3b5a:79bc:f7b5  prefixlen 64  scopeid 0x0<global>
        inet6 2804:d45:b94f:3a00:25bd:abb9:736b:8bdf  prefixlen 64  scopeid 0x0<global>
        ether 98:83:89:f1:9e:d3  txqueuelen 1000  (Ethernet)
        RX packets 4192  bytes 2516353 (2.5 MB)
        RX errors 0  dropped 3  overruns 0  frame 0
        TX packets 2382  bytes 263136 (263.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 1320  bytes 149122 (149.1 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1320  bytes 149122 (149.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0  
default via 192.168.100.1 dev enp2s0 proto dhcp metric 100 
169.254.0.0/16 dev enp2s0 scope link metric 1000 
192.168.1.0/24 dev enp2s0 scope link 
192.168.100.0/24 dev enp2s0 proto kernel scope link src 192.168.100.8 metric 100
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 98:83:89:f1:9e:d3 brd ff:ff:ff:ff:ff:ff
    inet 192.168.100.8/24 brd 192.168.100.255 scope global dynamic noprefixroute enp2s0
       valid_lft 84362sec preferred_lft 84362sec
    inet 192.168.1.2/24 scope global enp2s0
       valid_lft forever preferred_lft forever
    inet6 2804:d45:b94f:3a00:60fe:3b5a:79bc:f7b5/64 scope global temporary dynamic 
       valid_lft 259193sec preferred_lft 83805sec
    inet6 2804:d45:b94f:3a00:25bd:abb9:736b:8bdf/64 scope global dynamic mngtmpaddr noprefixroute 
       valid_lft 259193sec preferred_lft 172793sec
    inet6 fe80::2935:29f7:51b4:b479/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: wlp1s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 98:83:89:e9:c7:00 brd ff:ff:ff:ff:ff:ff

Here is the output of "ifconfig", "ip route show" and "ip addr show" in my arch desktop:

eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.100.86  netmask 255.255.255.0  broadcast 192.168.100.255
        inet6 fe80::da5e:d3ff:fe21:4d51  prefixlen 64  scopeid 0x20<link>
        inet6 2804:d45:b94f:3a00:1060:ee2b:7069:a376  prefixlen 64  scopeid 0x0<global>
        inet6 2804:d45:b94f:3a00:da5e:d3ff:fe21:4d51  prefixlen 64  scopeid 0x0<global>
        ether d8:5e:d3:21:4d:51  txqueuelen 1000  (Ethernet)
        RX packets 81469  bytes 93087285 (88.7 MiB)
        RX errors 0  dropped 3977  overruns 0  frame 0
        TX packets 44845  bytes 5784637 (5.5 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp7s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.1.1  netmask 255.255.255.0  broadcast 0.0.0.0
        ether 50:3e:aa:0f:c0:f2  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 691  bytes 94052 (91.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 691  bytes 94052 (91.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether e8:84:a5:0d:52:2d  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
default via 192.168.100.1 dev eno1 proto dhcp src 192.168.100.86 metric 100 
192.168.1.0/24 dev enp7s0 scope link linkdown 
192.168.100.0/24 dev eno1 proto kernel scope link src 192.168.100.86 metric 100 
192.168.100.1 dev eno1 proto dhcp scope link src 192.168.100.86 metric 100 
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp7s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether 50:3e:aa:0f:c0:f2 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.1/24 scope global enp7s0
       valid_lft forever preferred_lft forever
3: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether d8:5e:d3:21:4d:51 brd ff:ff:ff:ff:ff:ff
    altname enp8s0
    inet 192.168.100.86/24 metric 100 brd 192.168.100.255 scope global dynamic eno1
       valid_lft 78400sec preferred_lft 78400sec
    inet6 2804:d45:b94f:3a00:1060:ee2b:7069:a376/64 scope global temporary dynamic 
       valid_lft 259002sec preferred_lft 78177sec
    inet6 2804:d45:b94f:3a00:da5e:d3ff:fe21:4d51/64 scope global dynamic mngtmpaddr noprefixroute 
       valid_lft 259002sec preferred_lft 172602sec
    inet6 fe80::da5e:d3ff:fe21:4d51/64 scope link 
       valid_lft forever preferred_lft forever
4: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether e8:84:a5:0d:52:2d brd ff:ff:ff:ff:ff:ff

Last edited by 1LKJHVC (2021-12-22 19:30:33)

Offline

#2 2021-12-22 18:40:42

bbus
Member
Registered: 2019-03-14
Posts: 49

Re: Can not ssh from my arch desktop to my ubuntu notebook

Tip: edit your post to use code tags for output from commands

What type of switch are you using? What do you mean by the "internet cable", is it a coax line from your provider? Is it an ethernet line from an ISP provided router?

Here is the output of "ifconfig", "ip route show" and "ip addr show" in my ubuntu notebook:

enp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.100.8  netmask 255.255.255.0  broadcast 192.168.100.255
...
Here is the output of "ifconfig", "ip route show" and "ip addr show" in my arch desktop:

eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.100.86  netmask 255.255.255.0  broadcast 192.168.100.255

It looks like your nic's (network interface card) are already getting (private) IP addresses from a DHCP server. You shouldn't need to assign IP addresses using the "ip" command.
It might be easier to fix if you reboot both machines (thus wiping the addresses and routes you have added manually) and include the output of:

$ ip link
$ ip addr

from both machines.
Other thing you need to include is what version of Ubuntu you are using. Often after installing the "ssh" package, you have to go into the gui settings and enable remote login under "sharing"(?) (I don't remember the exact submenu name, it has been a while since I've looked at it.)

Offline

#3 2021-12-22 19:26:14

1LKJHVC
Member
Registered: 2021-12-22
Posts: 3

Re: Can not ssh from my arch desktop to my ubuntu notebook

What type of switch are you using? What do you mean by the "internet cable", is it a coax line from your provider? Is it an ethernet line from an ISP provided router?

The internet cable I mentioned is just an ethernet cable from my modem to my switch. I do not know how to answer the question about what kind of switch, but the model is Switch Gigabit  TP-Link LS1005G and is compatible with Auto-MDI and MDIX.

Other thing you need to include is what version of Ubuntu you are using. Often after installing the "ssh" package, you have to go into the gui settings and enable remote login under "sharing"(?) (I don't remember the exact submenu name, it has been a while since I've looked at it.)

It is Ubuntu 20.04, I checked the remote login and it is enabled

Here is the output of the

 $ip link $ip addr 

on my arch after I rebooted the machine and erased the ip adresses I manually added:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp7s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
    link/ether 50:3e:aa:0f:c0:f2 brd ff:ff:ff:ff:ff:ff
3: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether d8:5e:d3:21:4d:51 brd ff:ff:ff:ff:ff:ff
    altname enp8s0
4: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
    link/ether e8:84:a5:0d:52:2d brd ff:ff:ff:ff:ff:ff
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp7s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether 50:3e:aa:0f:c0:f2 brd ff:ff:ff:ff:ff:ff
3: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether d8:5e:d3:21:4d:51 brd ff:ff:ff:ff:ff:ff
    altname enp8s0
    inet 192.168.100.86/24 metric 100 brd 192.168.100.255 scope global dynamic eno1
       valid_lft 86078sec preferred_lft 86078sec
    inet6 2804:d45:b94f:3a00:b374:5df5:3611:8818/64 scope global temporary dynamic 
       valid_lft 258877sec preferred_lft 85985sec
    inet6 2804:d45:b94f:3a00:da5e:d3ff:fe21:4d51/64 scope global dynamic mngtmpaddr noprefixroute 
       valid_lft 258877sec preferred_lft 172477sec
    inet6 fe80::da5e:d3ff:fe21:4d51/64 scope link 
       valid_lft forever preferred_lft forever
4: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether e8:84:a5:0d:52:2d brd ff:ff:ff:ff:ff:ff

Same thing but for the ubuntu machine:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
    link/ether 98:83:89:f1:9e:d3 brd ff:ff:ff:ff:ff:ff
3: wlp1s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 98:83:89:e9:c7:00 brd ff:ff:ff:ff:ff:ff
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 98:83:89:f1:9e:d3 brd ff:ff:ff:ff:ff:ff
    inet 192.168.100.8/24 brd 192.168.100.255 scope global dynamic noprefixroute enp2s0
       valid_lft 86379sec preferred_lft 86379sec
    inet6 2804:d45:b94f:3a00:f0dc:71f2:ed69:2b2/64 scope global temporary dynamic 
       valid_lft 259181sec preferred_lft 85972sec
    inet6 2804:d45:b94f:3a00:25bd:abb9:736b:8bdf/64 scope global dynamic mngtmpaddr noprefixroute 
       valid_lft 259181sec preferred_lft 172781sec
    inet6 fe80::2935:29f7:51b4:b479/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: wlp1s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 98:83:89:e9:c7:00 brd ff:ff:ff:ff:ff:ff

Last edited by 1LKJHVC (2021-12-22 19:28:07)

Offline

#4 2021-12-22 19:41:22

bbus
Member
Registered: 2019-03-14
Posts: 49

Re: Can not ssh from my arch desktop to my ubuntu notebook

To connect from Arch to your Ubuntu (this is the direction that was giving you issues, right?), try this on your Arch Linux command line:

ssh ubuntu_username@192.168.100.8

Offline

#5 2021-12-22 20:24:17

1LKJHVC
Member
Registered: 2021-12-22
Posts: 3

Re: Can not ssh from my arch desktop to my ubuntu notebook

It works! Thank you very much

Last edited by 1LKJHVC (2021-12-22 20:25:08)

Offline

#6 2021-12-22 20:46:40

bbus
Member
Registered: 2019-03-14
Posts: 49

Re: Can not ssh from my arch desktop to my ubuntu notebook

Glad to hear.

Mark the thread [Solved] by editing the title of the first post.

Read the networking (and related) arch wiki page(s) to understand why it worked.

Offline

Board footer

Powered by FluxBB