Score:0

How do i make a Static ip available over a network

tv flag

I'm running ubuntu server 20.04 LTS in raspi 4 model B.

I want to set a static IP in one raspi and run API over that ip and that must me accessible over the the network to which I'm connected to. I have wlan0 and wlan1 in both devices.

For example i want to connect wlan0 (with static ip) of device1 to a router and device2 will also be connected to the same router and I must be able to access the static ip of the device1 in device2

Is this possible i tried few configurations but i was not able to connect to the IP remotely

Edit : Content of yaml file is as below

network:
  ethernets:
    eth0:
      dhcp4: true
      optional: true
  version: 2
  wifis:
    wlan0:
      dhcp4: no
      dhcp6: no
      addresses: [192.168.0.200/24]
      gateway4: 192.168.0.1
      nameservers:
        addresses: [8.8.8.8,8.8.4.4]
      access-points:
        "SSID":
          password: *********
    wlan1:
      access-points:
        "SSID":
          password: *********
      dhcp4: true
      optional: true
ar flag
The easiest way may be to reserve the IP address assigned by the router via the router set up. You will need to know the MAC address associated with the Raspberry Pi's wlan0 interface. Each router is different and this is beyond the scope of this site.
Eldho K K avatar
tv flag
No i can't do this because this will be a production device, i can't get access to their routers
ar flag
You will need to know which IP address will be available in the production environment for static allocation and assign an IP address from that pool.
ar flag
You may find [Ubuntu 17.10 Server static IP netplan - how to set netmask](https://askubuntu.com/questions/972955/ubuntu-17-10-server-static-ip-netplan-how-to-set-netmask) useful. Please post the content of the file `/etc/netplan/01-netcfg.yaml` in [your question](https://askubuntu.com/posts/1443294/edit).
Eldho K K avatar
tv flag
I think i tried the same thing but it didn't work and also stopped blocked internet connection
ar flag
Make sure the IP address you want to use as static, `192.168.0.200`, is not within the range the router uses to dynamically assign IP addresses. Look in the "DHCP Server" section of your router. My router reserves the range `192.168.0.100` to `192.168.0.249` for dynamic assignment. If you assign a static IP address within this range, there may be a conflict as the router may assign the same IP to another device.
ar flag
What do you get when you use the command `sudo netplan try`? What is the output of `ip a`?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.