Configuring static IP
#1
Hello!

I am trying to assign static IPs to two pines and be able for them to ping each other(for future ssh).

I have edited /etc/network/interfaces:


Code:
interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
# source-directory /etc/network/interfaces.d
# commented out, so it doesnt conflict with this config

# Disable wlan1 by default (8723bs has two intefaces)
iface wlan1 inet manual

auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 4.2.2.1 4.2.2.2 8.8.8.8


similarly the second one with the IP: 192.168.1.101, left everything else the same.

I also set managed=true /etc/NetworkManager/NetworkManager.conf so it uses the data from /etc/network/interfaces

Code:
[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq

[ifupdown]
managed=true

After a restart I can see in the network manager that both of them are corretly configured, but if I try to ping them with(from 192.168.1.101):
ping 192.168.1.100
it doesnt work.

but if I try to ping the address of my switch: 192.168.1.1, it works on both of them.

The switch in configured with the same gateway and IP: 192.168.1.1
I used longsleeps 10160528 desktop build.
I also cant go on the internet, which is connected to the switch. But between them is a router. Do I have to find out the IP of the router and set it the gateway address of the switch?

I tried using diffrent addresses for the switch(like 192.168.1.2) and use this as a gateway address in /etc/network/interfaces, but still nothing.

Any suggestions on how to make this work?
Also keep in mind, that I am a linux beginner and never did any real networking, so if you can, answer with detailed explanations and forgive my noobism.
Everything happens on purpose by accident.
  Reply
#2
The first thing to check is that they each have a unique mac address.

... communication actually happens between mac addresses,  with adress resolution protocol ( ARP ) going on in the middle. It the mac addresses are the 'same' then the machines cannot communicate correctly.

This is a problem on the pine, for some of the gnu+linux images, because each machine ends up with the same mac address.   (rats)

cat  /boot/uEnv.txt

... for each machine;  what is the mac addy ?
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
  Reply
#3
Yes, you nailed it. It didnt work, because each mac address was the same.

I downloaded macchanger, changed the mac-s, tried pinging and it worked.

Thanks for the help!

If I set the switch gateway to anything else, then the internet also works(gateway on pine set to switch address).
Everything happens on purpose by accident.
  Reply
#4
Can anyone help me configure my static IP for Pine.
I have ASUS router behind ISP modem and I connect to it on 192.168.2.1

Now I have setup static IP on pine but I'm doing something wrong!
(lack of knowledge)

/etc/network/interfaces:
Code:
interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
# source-directory /etc/network/interfaces.d
# commented out, so it doesnt conflict with this config

# Disable wlan1 by default (8723bs has two intefaces)
iface wlan1 inet manual

auto eth0
iface eth0 inet static
  address 192.168.2.172
  network 192.168.2.0
  netmask 255.255.255.0
  gateway 192.168.2.1

ipconfig:
[Image: 8084e33bfd.png]
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  possible to set a static IP using uEnv.txt? cplr 2 1,240 05-13-2016, 06:57 AM
Last Post: RanTalbott

Forum Jump:


Users browsing this thread: 1 Guest(s)