Static IP Address in Pi_Star

Help setting up WiFi
Post Reply
N8OFP
Posts: 10
Joined: Wed Apr 11, 2018 10:22 pm

Static IP Address in Pi_Star

Post by N8OFP » Sat Jun 06, 2020 5:06 pm

I have a Verizon MiFi hotspot that I tether my Pi-Star hotspot to when I am away from home. The Hotspot connects up fine and work perfectly via the MiFi. But when I want to connect to Pi-Star, to make a change or shut down, I have to first log into the MiFi and find out which IP Address was given to Pi-Star. The MiFi does not have the ability to Reserve and IP Address. So I was wondering if there was someway to set a static IP in Pi-Star so I wouldn't have to constantly log into the MiFi.

Thank you!

M1DNS
Posts: 756
Joined: Thu Apr 05, 2018 5:30 am

Re: Static IP Address in Pi_Star

Post by M1DNS » Sat Jun 06, 2020 5:29 pm

Yep you can do that. Just Google "setting a static ip in raspbian buster"

Just remember to use the rpi-rw command before you follow any other how-to so the pistar files are writable.

Sent from my SM-G935F using Tapatalk


Andrew M1DNS.
Pi-star Admin Team.

N8OFP
Posts: 10
Joined: Wed Apr 11, 2018 10:22 pm

Re: Static IP Address in Pi_Star

Post by N8OFP » Sat Jun 06, 2020 9:57 pm

Thank You!!

User avatar
VK7HSE
Posts: 196
Joined: Sun Apr 15, 2018 6:35 pm
Contact:

Re: Static IP Address in Pi_Star

Post by VK7HSE » Sun Jun 07, 2020 7:27 am

You need to edit the file dhcpcd.conf this is located in /etc

The format is as follows...

Code: Select all

 
Interface eth0
static ip_address=192.168.0.2/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1

interface wlan0
static ip_address=192.168.0.12/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1
You can place this at the end of the file as everything is # out so non of the examples are active.

Naturally change the static IP needs to be adjusted to suit your needs and the static routes need to point to your router or a 3rd party service provider if that's what you use (most likely not)

Sent from my Pixel 4 XL using Tapatalk


N8OFP
Posts: 10
Joined: Wed Apr 11, 2018 10:22 pm

Re: Static IP Address in Pi_Star

Post by N8OFP » Sun Jun 07, 2020 10:39 am

Thank you again for all your help. After looking through several web pages on adding a static IP it appears that setting a Static IP Address in Pi-Star would be global setting to all network connections. Here is my current setup, I am using a MMDVM board on a Raspberry Pi Zero W. I want to be able to use it at home, connected to my home WiFi and portable using my MiFi device.

Current setup;
Home Network - When I am at home the hotspot is connected to my home WiFi. My home router has an IP Reservation for the hotspot's mac address of 192.168.1.xxx

Portable MiFi - When I am away from home and using the MiFi Hotspot, the MiFi gives Pi-Star an IP Address of 192.168.2.xxx

I was hoping there would be a way that I could set the Static IP Address only for the MiFi's SSID so it would continue to use the DHCP IP Reservation when it connects to my home network.

NQ4T
Posts: 44
Joined: Mon Aug 06, 2018 11:48 pm

Re: Static IP Address in Pi_Star

Post by NQ4T » Fri Jun 26, 2020 3:47 pm

My suggestion is to see if your router has the ability to set static assignments in its DHCP table. This way PiStar uses DHCP at all tines, but your main router will ensure it has the same IP.

AF6VN
Posts: 410
Joined: Fri Jul 20, 2018 1:15 am

Re: Static IP Address in Pi_Star

Post by AF6VN » Fri Jun 26, 2020 4:31 pm

N8OFP wrote:
Sun Jun 07, 2020 10:39 am
Current setup;
Home Network - When I am at home the hotspot is connected to my home WiFi. My home router has an IP Reservation for the hotspot's mac address of 192.168.1.xxx

Portable MiFi - When I am away from home and using the MiFi Hotspot, the MiFi gives Pi-Star an IP Address of 192.168.2.xxx

I was hoping there would be a way that I could set the Static IP Address only for the MiFi's SSID so it would continue to use the DHCP IP Reservation when it connects to my home network.
You have a more significant problem... 192.168.1.* and 192.168.2.* (in original "private LAN class" usage) are two disjoint networks. If you did force the R-Pi to use 192.168.1.* on both systems, it likely would not route through the portable -- which is considering "its" local nodes to be on 192.168.2.*

https://en.wikipedia.org/wiki/Private_n ... _addresses
16-bit block 192.168.0.0 – 192.168.255.255 65536 192.168.0.0/16 (255.255.0.0) 16 bits 16 bits 256 contiguous class C networks
Note the part I underlined... 192.168.0.* to 192.168.255.* are separate networks in this system, each having 254 nodes (not 256 as one value is used as a broadcast address *.*.*.255, and another is considered the network address *.*.*.0 as I recall)

https://en.wikipedia.org/wiki/IP_address
The size of the routing prefix of the address is designated in CIDR notation by suffixing the address with the number of significant bits, e.g., 192.168.1.15/24, which is equivalent to the historically used subnet mask 255.255.255.0.
I suspect the recommended solution is to configure both ROUTERS to use 1) the same subnet (192.168.1.* for example), and 2) use the router configuration to assign a known IP based upon the MAC address of the device connecting.

Addendum: assuming the 4510L manual applies to your device, item 1 appears to be covered by page 38-39 (IP # of the device, and also the range of IP # available for DHCP assignment. Unfortunately, item 2 is not available. So... setting both home and portable routers to the same subnet should be possible, and both should have ranges for DHCP and static IP # provided by client device. Setting the R-Pi to a static address outside the DHCP range of both routers should then work -- so long as both routers are using the same subnet [which could be a problem IF you are in range of both at the same time, as you might randomly be connected to one or the other

--
AF6VN
Dennis L Bieber

NQ4T
Posts: 44
Joined: Mon Aug 06, 2018 11:48 pm

Re: Static IP Address in Pi_Star

Post by NQ4T » Sun Jun 28, 2020 5:33 pm

AF6VN wrote:
Fri Jun 26, 2020 4:31 pm
You have a more significant problem... 192.168.1.* and 192.168.2.* (in original "private LAN class" usage) are two disjoint networks. If you did force the R-Pi to use 192.168.1.* on both systems, it likely would not route through the portable -- which is considering "its" local nodes to be on 192.168.2.*
The main reason they're "disjointed" is merely due to how IP routing works. Why can't a PC with a 192.168.1.0/24 IP talk to a 192.168.2.0/24 IP if they're on the same cable? Because the 192.168.1.0/24 machine defaults all traffic for other networks through the gateway. Same happens on the 192.168.2.0/24 machine. But if you somehow tell the machines that traffic to those subnets is to just go out over the interface and not through a gateway...they'll talk.

As has been mentioned...the easiest solution would be to just set DHCP IP reservations (static assignments as some routers call them) and not actually set a static IP on PiStar itself. My phone's hotspot sticks everything on 192.168.37.0/24 and I have absolutely no ability to set routing to a different subnet; I've seen hotspots that isolate everybody by sticking them on their own subnet and not allowing routing between them. In fact I've moved away from setting static assignments on devices to setting static assignments in a DHCP table...that way if I have to move that device to a different network; I won't have to jump through hoops of adding routes in order to talk to it.

This is basically what I do at home in multiple fashions. Most of my personal devices have their DHCP assignments set static by MAC address; so I know my laptop is always .164, my phone is always .156, my dstar hotspot is always .10, dmr is always .11, fusion is .12, my Dell's iDRAC is .2, hypervisor's dom0 runs on .3, my VMs are all .4 - .9 except the networking/gateway VM which is .253. All the devices themselves are just setup for DHCP. My NAS is physically plugged in to one of my Dell's network ports and it's on a 10.1.1.0/24 network. How do I access it from the LAN? I told my router that 192.168.1.253 was the gateway to 10.1.1.0/24. The Synology gets it's 10.1.1.2/24 assignment from the DHCP server on the networking VM. The VM's have static 10.1.1.0/24 assignments since they're not physical machines.

Hotspots connect to my phone...they get a phone assignment. They do it on someone else's wifi...I just have to scan the subnet and find them if their hostnames aren't resolving.

Sorry for getting off on a tangent...but when it comes to stuff like this networking is a requirement.

Now if the particular model of MiFi doesn't allow DHCP static assignments...then the next option would be to somehow see if you could tell the main router that it's also part of the 192.168.2.0/24 network. But *that* depends on how your home router works. I don't even know if I can do it through mine due to how it's interface limits everything.

Post Reply