Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IP Address Confusion [SOLVED]
#1
I had to reinstall raspbian the other day on my Raspberry Pi 3B+. No big deal.

I need a static IP for it and want to use the same ones as I used last time, that is 192.168.0.29 for the eth0 interface and 192.168.0.30 for the wlan0 interface.

I set those up and my dhcpcd.conf file is attached, but the Pi keeps telling me that 192.168.0.29 is being used for wlan0 and 192.168.0.30 is being used for eth0. I don't want this. I tried swaping the IPs in the dhcpcd.conf file, but that dosen't chande anything.

Output of ifconfig:
Code:
$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
       inet 192.168.0.30  netmask 255.255.255.0  broadcast 192.168.0.255
       inet6 2604:2d80:d40f:d600:ba27:ebff:feb8:1b2  prefixlen 64  scopeid 0x0<global>
       inet6 fe80::ba27:ebff:feb8:1b2  prefixlen 64  scopeid 0x20<link>
       inet6 fd00:688f:2e75:1932:ba27:ebff:feb8:1b2  prefixlen 64  scopeid 0x0<global>
       ether b8:27:eb:b8:01:b2  txqueuelen 1000  (Ethernet)
       RX packets 1462  bytes 128376 (125.3 KiB)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 861  bytes 288339 (281.5 KiB)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
       inet 127.0.0.1  netmask 255.0.0.0
       inet6 ::1  prefixlen 128  scopeid 0x10<host>
       loop  txqueuelen 1000  (Local Loopback)
       RX packets 9  bytes 524 (524.0 B)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 9  bytes 524 (524.0 B)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
       inet 192.168.0.29  netmask 255.255.255.0  broadcast 192.168.0.255
       inet6 2604:2d80:d40f:d600:ba27:ebff:feed:54e7  prefixlen 64  scopeid 0x0<global>
       inet6 fe80::ba27:ebff:feed:54e7  prefixlen 64  scopeid 0x20<link>
       inet6 fd00:688f:2e75:1932:ba27:ebff:feed:54e7  prefixlen 64  scopeid 0x0<global>
       ether b8:27:eb:ed:54:e7  txqueuelen 1000  (Ethernet)
       RX packets 83  bytes 11931 (11.6 KiB)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 50  bytes 9013 (8.8 KiB)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


Output of ip addr:
Code:
$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
   link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
   inet 127.0.0.1/8 scope host lo
      valid_lft forever preferred_lft forever
   inet6 ::1/128 scope host
      valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
   link/ether b8:27:eb:b8:01:b2 brd ff:ff:ff:ff:ff:ff
   inet 192.168.0.30/24 brd 192.168.0.255 scope global noprefixroute eth0
      valid_lft forever preferred_lft forever
   inet6 fd00:688f:2e75:1932:ba27:ebff:feb8:1b2/64 scope global dynamic mngtmpaddr
      valid_lft 535272sec preferred_lft 401415sec
   inet6 2604:2d80:d40f:d600:ba27:ebff:feb8:1b2/64 scope global dynamic mngtmpaddr
      valid_lft 1209444sec preferred_lft 604644sec
   inet6 fe80::ba27:ebff:feb8:1b2/64 scope link
      valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
   link/ether b8:27:eb:ed:54:e7 brd ff:ff:ff:ff:ff:ff
   inet 192.168.0.29/24 brd 192.168.0.255 scope global noprefixroute wlan0
      valid_lft forever preferred_lft forever
   inet6 fd00:688f:2e75:1932:ba27:ebff:feed:54e7/64 scope global dynamic mngtmpaddr
      valid_lft 535272sec preferred_lft 401415sec
   inet6 2604:2d80:d40f:d600:ba27:ebff:feed:54e7/64 scope global dynamic mngtmpaddr
      valid_lft 1209444sec preferred_lft 604644sec
   inet6 fe80::ba27:ebff:feed:54e7/64 scope link
      valid_lft forever preferred_lft forever


Attached Files
.txt   dhcpcd.conf.txt (Size: 1.96 KB / Downloads: 10)
Just a teen who LOVES working with computers
Reply
#2
(10-17-2019, 09:56 PM)Jeremiah Wrote: I had to reinstall raspbian the other day on my Raspberry Pi 3B+. No big deal.

I need a static IP for it and want to use the same ones as I used last time, that is 192.168.0.29 for the eth0 interface and 192.168.0.30 for the wlan0 interface.

I set those up and my dhcpcd.conf file is attached, but the Pi keeps telling me that 192.168.0.29 is being used for wlan0 and 192.168.0.30 is being used for eth0. I don't want this. I tried swaping the IPs in the dhcpcd.conf file, but that dosen't chande anything.

Output of ifconfig:
Code:
$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
       inet 192.168.0.30  netmask 255.255.255.0  broadcast 192.168.0.255
       inet6 2604:2d80:d40f:d600:ba27:ebff:feb8:1b2  prefixlen 64  scopeid 0x0<global>
       inet6 fe80::ba27:ebff:feb8:1b2  prefixlen 64  scopeid 0x20<link>
       inet6 fd00:688f:2e75:1932:ba27:ebff:feb8:1b2  prefixlen 64  scopeid 0x0<global>
       ether b8:27:eb:b8:01:b2  txqueuelen 1000  (Ethernet)
       RX packets 1462  bytes 128376 (125.3 KiB)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 861  bytes 288339 (281.5 KiB)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
       inet 127.0.0.1  netmask 255.0.0.0
       inet6 ::1  prefixlen 128  scopeid 0x10<host>
       loop  txqueuelen 1000  (Local Loopback)
       RX packets 9  bytes 524 (524.0 B)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 9  bytes 524 (524.0 B)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
       inet 192.168.0.29  netmask 255.255.255.0  broadcast 192.168.0.255
       inet6 2604:2d80:d40f:d600:ba27:ebff:feed:54e7  prefixlen 64  scopeid 0x0<global>
       inet6 fe80::ba27:ebff:feed:54e7  prefixlen 64  scopeid 0x20<link>
       inet6 fd00:688f:2e75:1932:ba27:ebff:feed:54e7  prefixlen 64  scopeid 0x0<global>
       ether b8:27:eb:ed:54:e7  txqueuelen 1000  (Ethernet)
       RX packets 83  bytes 11931 (11.6 KiB)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 50  bytes 9013 (8.8 KiB)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


Output of ip addr:
Code:
$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
   link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
   inet 127.0.0.1/8 scope host lo
      valid_lft forever preferred_lft forever
   inet6 ::1/128 scope host
      valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
   link/ether b8:27:eb:b8:01:b2 brd ff:ff:ff:ff:ff:ff
   inet 192.168.0.30/24 brd 192.168.0.255 scope global noprefixroute eth0
      valid_lft forever preferred_lft forever
   inet6 fd00:688f:2e75:1932:ba27:ebff:feb8:1b2/64 scope global dynamic mngtmpaddr
      valid_lft 535272sec preferred_lft 401415sec
   inet6 2604:2d80:d40f:d600:ba27:ebff:feb8:1b2/64 scope global dynamic mngtmpaddr
      valid_lft 1209444sec preferred_lft 604644sec
   inet6 fe80::ba27:ebff:feb8:1b2/64 scope link
      valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
   link/ether b8:27:eb:ed:54:e7 brd ff:ff:ff:ff:ff:ff
   inet 192.168.0.29/24 brd 192.168.0.255 scope global noprefixroute wlan0
      valid_lft forever preferred_lft forever
   inet6 fd00:688f:2e75:1932:ba27:ebff:feed:54e7/64 scope global dynamic mngtmpaddr
      valid_lft 535272sec preferred_lft 401415sec
   inet6 2604:2d80:d40f:d600:ba27:ebff:feed:54e7/64 scope global dynamic mngtmpaddr
      valid_lft 1209444sec preferred_lft 604644sec
   inet6 fe80::ba27:ebff:feed:54e7/64 scope link
      valid_lft forever preferred_lft forever

In your config file you have a space between static ip =(space here does not belong)  192.168.0.29/30 instead of static ip=192.168.0.29/30 you seem to have done that on the static ip lines only.
Reply
#3
Revived the spaces, still says that wlan0 is 192.168.0.29 and eth0 is 192.168.0.30.
Just a teen who LOVES working with computers
Reply
#4
Well while it should make no difference try changing the order of the interfaces in the file so it reads eth0 before wlan0.
Reply
#5
Still nope. A copy of the dhcpcd.conf file with all the new modifications done is below.


Attached Files
.txt   dhcpcd.conf.txt (Size: 1.96 KB / Downloads: 9)
Just a teen who LOVES working with computers
Reply
#6
(10-19-2019, 10:33 PM)Jeremiah Wrote: ....

Question: Is there a reason you cannot use static IP assignment in your router for each interface? If not, that would be the simplest solution.
Reply
#7
So my family doesn't actually own our router. We rent it from our ISP (Mediacom). I am not sure how to do this with a router that I don't know the exact credentials for.
Just a teen who LOVES working with computers
Reply
#8
(10-20-2019, 12:51 AM)Jeremiah Wrote: So my family doesn't actually own our router. We rent it from our ISP (Mediacom). I am not sure how to do this with a router that I don't know the exact credentials for.

After looking at Mediacom's site, the user configurability of their hardware is very limited. But, according to their site you are allowed to use your own modem and router, and would give you much more control of your network.
Reply
#9
(10-20-2019, 12:51 AM)Jeremiah Wrote: So my family doesn't actually own our router. We rent it from our ISP (Mediacom). I am not sure how to do this with a router that I don't know the exact credentials for.

Since you apparantly have little to no way of configuring the network, setting up a static IP for your Pi might actually be impossible. Usually I would say that assigning a static IP should be doable via the webinterface, but according to SRWs research, this might not be the case here. I personally find that rather weird, but it seems like ISPs allowed to take a lot more freedom away from the user outside of europe.

I actually have the same problem with my Pi, as I am currently living in a students dorm. So I know its a bad situation, since a Pi of which you do not know the IP is considerably less usable.

I see two immediate solutions to this: Either create your own network, as a slave of the master network (imagine a router that is not connected to a modem but to your current router), or hope that automatic hostname resolution is enabled on the router. The latter would obviously be the easier solution; It causes the router to provide DNS entries for all computers in the local net based on their hostname. As an example, my laptops hostname is 'tarazed' and my mother has a fritz-box router, so if I want to ping my laptop in that network, I could do it with 'ping tarazed.fritz.box'. With this enabled, you would not need to have a static IP, as you could always reach the Pi via its hostname.
My website - My git repos

"Things are only impossible until they’re not." - Captain Jean-Luc Picard
Reply
#10
So I am going to guess that your modem/router defaults to running dhcp because most do, but you can't change the .conf file for whatever reason.
What I am going to suggest is they may not have set the internal dhcp on the router as authoritative, if so you can have your deamon override it by adding the line authoritative at the beginning of the file on your dhcp server like so:


A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

#Set this server as official DHCP server for this network.
authoritative;

# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel

# Inform the DHCP server of our hostname for DDNS.
hostname


After adding that to the .conf file restart your dhcp and restart your Pi afterwards.
(If it causes problems you can comment it back out.)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)