Tuesday, May 7, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 14099  / 2 Years ago, sat, july 23, 2022, 5:34:07

I am trying to connect my desktop running Ubuntu 16.04 to a Raspberry Pi3 running Ubuntu MATE. The end goal is to ssh using Ethernet connection by assigning static IP addresses to PC (say 10.0.0.1) and to Pi (say 10.0.0.2).


Then I can do ssh [email protected] from the PC, right?. I have connected PC and Pi using ethernet/lan cable. Then I disabled Enable Wi-Fi option on Raspberry Pi and I can see that it is connected to Wired Connection 1. Running ifconfig command on the Raspberry Pi gives:


pi@pi-desktop:~$ ifconfig 
enxb827eb3d64cc Link encap:Ethernet HWaddr b8:27:eb:3d:64:cc
inet addr:192.168.100.1 Bcast:192.168.100.255 Mask:255.255.255.0
inet6 addr: fe80::afe3:308f:92f3:e890/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:662 errors:0 dropped:0 overruns:0 frame:0
TX packets:111 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:151040 (151.0 KB) TX bytes:19190 (19.1 KB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:21628 errors:0 dropped:0 overruns:0 frame:0
TX packets:21628 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:1300280 (1.3 MB) TX bytes:1300280 (1.3 MB)

Then I was planning to set PCs IP address to 192.168.100.2 but it is not connected to Wired Connection 1 even with Enable Wi-Fi disabled. Running ifconfig on PC gives:


pc@pc-desk:~$ ifconfig
enp3s0 Link encap:Ethernet HWaddr 74:d4:35:d1:2c:f4
inet6 addr: fe80::181f:fbbb:63d2:c4e4/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:106 errors:0 dropped:0 overruns:0 frame:0
TX packets:1386 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:17736 (17.7 KB) TX bytes:263114 (263.1 KB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:9695 errors:0 dropped:0 overruns:0 frame:0
TX packets:9695 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:845799 (845.7 KB) TX bytes:845799 (845.7 KB)

I am stuck here. Any pointers would be highly appreciated.


Edit: Output of ethtool


On PC:


pc@pc-desk:~$ ethtool enp3s0

Settings for enp3s0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Link partner advertised pause frame use: Symmetric Receive-only
Link partner advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Cannot get wake-on-lan settings: Operation not permitted
Current message level: 0x00000033 (51)
drv probe ifdown ifup
Link detected: yes

On Raspberry Pi :


pi@pi-desktop:~$ ethtool enxb827eb3d64cc
Settings for enxb827eb3d64cc:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Link partner advertised pause frame use: Symmetric Receive-only
Link partner advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Cannot get wake-on-lan settings: Operation not permitted
Current message level: 0x00000007 (7)
drv probe link
Link detected: yes

Output of uname -a command:


On Raspberry Pi:


pi@pi-desktop:~$ uname -a
Linux pi-desktop 4.4.38-v7+ #938 SMP Thu Dec 15 15:22:21 GMT 2016 armv7l armv7l armv7l GNU/Linux

On PC:


pc@pc-desk:~$ uname -a
Linux pc-desk 4.13.0-26-generic #29~16.04.2-Ubuntu SMP Tue Jan 9 22:00:44 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

More From » networking

 Answers
4

You have to configure both sides with the static IP addresses you intent to use.



The ifconfig output for the PC tells me that the interface is not up and no IP is configured - we have to remedy that.



To cover our bases you should make sure your cabling is fine, you can do that with ethtool on both sides



sudo apt-get install ethtool


then on the Pi:



ethtool enxb827eb3d64cc


and on the PC:



ethtool enp3s0


Look for



Link detected: yes


and make sure that speed and duplex are the same on both sides, with a Pi it should look like



Speed: 100Mb/s
Duplex: Full


Now you can change your IPs temporarily (not reboot safe) with



ifconfig enp3s0 10.0.0.2 netmask 255.255.255.0 up


on the PC and the following on the Pi



ifconfig enxb827eb3d64cc 10.0.0.1 netmask 255.255.255.0 up


No gateway needed since they are both in the same network.



A permanent solution would be to set the IPs either in the GUI or in the config file called /etc/network/interfaces.



This depends heavily on the GUI you use but something similar to



Preferences -> Connections->Edit connections->IPv4 settings


should be it on both the PC and the Pi



Here is a good example of how to set a static IP. Just keep in mind that you may have to disable the GUIs network settings (i.e. gnome's Network Manager tends to overwrite and override this unless disabled)



(or whatever range you have decided to use, just make sure they are in the same range)


[#9254] Sunday, July 24, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
huovie

Total Points: 234
Total Questions: 99
Total Answers: 105

Location: Central African Republic
Member since Sun, Feb 26, 2023
1 Year ago
;