Static Ip address not taking

Hello i tried to search online how to change my manual ip address for a Static ip address and all attempted failed on me. I even looked in here and saw the same thing as i was seeing online But nothing worked. Can someone please help me out and try to figure this out. Thank you.

Joseph

You will need to tell people what your system is. Windows, Synology, Openhabian ?
Then you will need to add some more about “nothing worked”. What did you change, what was the result?

Hello and you know what you are right that is my fault and I’m sorry about that. I’m still a little new to the whole linux world and openham plus the networking please forgive me.

This is my setup i currently have. I always wanted to do some home automation around my apartment. But at the time cost was a lot into recently i saw a guy on youtube his channel is call MK-Smarthouse. He teach everyone how how setup there own DIY smarthouse using a Raspberry pi 3 and OpenHabian2 i think it is. So i followed his Instructions and it took me a while to setup because my Internet connection is not so great where I’m at. I mange to get 1 door sensor setup and one light switch setup.

But this is what i came into the problem. Sense my internet is a 3G unlimited air card twice a day i have to reboot my internet connection because it slows down. And when that happens Ip addresses change on my computers, tablets and cellphone. Now the Openhab server i haveto reboot to get the network to come back. So sense i have my door sensor and light sensor on a 192.168.0.240 address my network is a 192.168.0.xxx network that is what it was setup for.

So now to the point sorry for all this i was trying to explain my whole setup. I tried to go into the networking/interfaces and change it from main lan to a static ip address. So i went online and saw it can be done a few ways i tired them and nothing changed i rebooted everything i change something. But nothing changed. And now I’m here.

Well, don’t know what you have looked at, or what you have tried, or how you know that nothing changed.

Maybe start here

Hello yes I was trying to post it last night but i had some power outage because of the bad storm we had no power for over 12 hours. I’m sorry about that I tried to post stuff from my phone but it is very hard to copy and paste code on a cellphone. Here is what i did.
I went to https://wiki.debian.org/NetworkConfiguration and found this one

auto eth0
iface eth0 inet static
address 192.168.0.240
netmask 255.255.255.0
gateway 192.168.0.1

I also went to

https://www.modmypi.com/blog/how-to-give-your-raspberry-pi-a-static-ip-address-update
and tried

interface eth0

static ip_address=192.168.0.240/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1

Same thing nothing. On both times i have tired i rebooted to make sure it kicked in. but nothing happens still displayed the same I address into i rebooted my internet card and ip address changed like it was still a dynamic manual address.

Hello I’m now able to change the Ip address to a Static IP address. I watched this video. Youtube video But now I’m not able to ping out keeps saying network unavailable. But yet I’m able to remote putty in and do whatever i need to do now. I can Ping within the network but just not outside of the network.

Perhaps your new static IP is not in the same subnet as your router. Perhaps you have not set the gateway and/or dns addresses to match your router.

my router starts at 192.168.0.254 and goes down 253,252,251 Not sure why it is a Verzon setup. But i can go to my laptop and manually change my IP address to 192.168.0.240 subnetmask to 255.255.255.0 gateway 192.168.0.1 and DNS to 192.168.0.1 and i can get online with no problem with that ip address. I can also see that ip address in windows Command line under ipconfig it displays that address.

So there one thing left the gateway and dns. The only problem is i went to that site in your other post and it told me to do

auto eth0
iface eth0 inet static
address 192.0.2.7
netmask 255.255.255.0
gateway 192.0.2.254

Even when i did this Nothing changed it still keep displaying the manual address and did not change.

But when i viewed in the view i did how he did it changed because i went into the dhcpcd.conf file and added

staticinterface eth0
static ip_address=192.168.0.240/24
static router=192.168.0.1
static domain_name_servers=192.168.0.1

Not sure what else I’m missing to make it work?

You are supposed to substitute your own numbers here. Clearly 192.0.2.xx wasn’t going to work with your Verizon, which you tell us is 192.168.0.1

I have no idea if that data gets put in the same place as the video that you have now followed, maybe you need to go back and re-do that change as well.

hello sorry that was the example code i did change all information to mine and it didn’t work.

The second one i did in the dhcpcd.conf file did work but did not go out side of my network. I’m guessing i need to address the gateway and DNS. But sense that is different then the old setup. I’m unsure how to do it.