Can't get static IP to work

Ask questions about Arch Linux ARM. Please search before making a new topic.

Can't get static IP to work

Postby Dgameman1 » Sun Nov 13, 2016 9:39 am

Hello! The goal is to get the static IP of my Raspberry Pi to be 192.168.0.34

I've tried DHCPD as well as netctl.

Inside the /etc/netctl/ location, I have a file I copied from /etc/netctl/examples into /etc/netctl/.

The file is called ethernet-static. This is what it's inside ethernet-static...

Code: Select all
[daniel@pi netctl]$ cat ethernet-static
Description='A basic static ethernet connection'
Interface=eth0
Connection=ethernet
AutoWired=yes
IP=static
Address=('192.168.0.34/24)
#Routes=('192.168.0.0/24 via 192.168.1.2')
Gateway=('192.168.0.1')
DNS=('8.8.8.8' '8.8.4.4')

## For IPv6 autoconfiguration
#IP6=stateless

## For IPv6 static address configuration
#IP6=static
#Address6=('1234:5678:9abc:def::1/64' '1234:3456::123/96')
#Routes6=('abcd::1234')
#Gateway6='1234:0:123::abcd'
[daniel@pi netctl]$


And when I type ifconfig I get

Code: Select all
[daniel@pi ~]$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.34  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::ba27:ebff:fe91:2b24  prefixlen 64  scopeid 0x20<link>
        inet6 2605:e000:9a43:c00:ba27:ebff:fe91:2b24  prefixlen 64  scopeid 0x0<global>


but when I try to ssh, I have to still do it to the old ip address which was 192.168.0.9.

When I try to ssh into the IP address i get the following error

Code: Select all
[daniel@daniel ~]$ ssh 192.168.0.34
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the FINGERPRINT key sent by the remote host is
SHA256:U+RANDOMSTUFF+JG/itMv54.
Please contact your system administrator.
Add correct host key in /home/daniel/.ssh/known_hosts to get rid of this message.
Offending FINGERPRINT key in /home/daniel/.ssh/known_hosts:1
FINGERPRINT host key for 192.168.0.34 has changed and you have requested strict checking.
Host key verification failed.
[daniel@daniel ~]$


But the weird part is that when I'm connected to my router, it still says that 192.168.0.9 is the pi address.
Dgameman1
 
Posts: 3
Joined: Sat Nov 12, 2016 3:42 am

Re: Can't get static IP to work

Postby graysky » Sun Nov 13, 2016 11:47 am

2 comments here.

1) Did you start the netctl profile? Did you disable systemd-networkd? Did you enable the netctl profile and reboot verifying that it works?

2) The ssh warning is to be expected if you had that IP assigned to another box in the past and now have it set to this one since they both would use different host keys.
graysky
 
Posts: 356
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000


Return to User Questions

Who is online

Users browsing this forum: No registered users and 3 guests