I changed /etc/network/interfaces to this
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.100.1
netmask 255.255.255.0
and ran
sudo ifdown eth0 && ifup eth0
but still there is no connection.
I changed g_serial to g_ether and my board is being detected as USB Ethernet/RNDIS Gadget on my pc but there is no connection. How do I ssh to the device? I tried with hostname.local but couldn't connect.