I have given static IP 192.168.137.20
with net mask 255.255.255.0
to my windows laptop port:
Then I connected my rasberry pi (which runs Ubuntu 20.04) using USB and ran following command to also give it a static IP and netmaskputtsdsdsd:
# sudo ifconfig eth0 192.168.137.50 netmask 255.255.255.0
Now both of them should be on same network. I connected my raspberry pi to my laptop using ethernet port and tried to connect to it over ssh using putty. Earlier it used to work with same procedure, but now it does not. In fact I am not able to ping each device from other device over Ethernet. I tried:
ping 192.168.137.50
on laptop and
ping 192.168.137.20
on raspberry pi. Both say Destination Host Unreachable.
Now only thing I recall could be an issue is some config file. I recall modifying /etc/resolv.conf
when I was able to connect over ssh, but not able to ping google. However, I changed it back, below is how it currently looks like:
# cat /etc/resolv.conf
# Generated by resolvconf
nameserver 127.0.0.1
Am I missing anything?
PS:
The ifconfig
shows following on rasberry pi:
eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.137.50 netmask 255.255.255.0 broadcast 192.168.137.255
ether 18:9b:a5:40:5d:59 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