Problems setting static IP address
I tried setting a static IP address as follows:
sudo nano /etc/dhcpcd.conf file with:
interface usb0
static ip_address=192.168.42.42/24
Unfortunately, it keeps changing from 192.168.42.XXX dynamically!
One thing I noticed between Raspbian and Gentoo on Pi is that the dhcpcd.conf file is empty on the former, but contains many entries in the latter.
Anyone know how to get the IP to stick in Gentoo?
sudo nano /etc/dhcpcd.conf file with:
interface usb0
static ip_address=192.168.42.42/24
Unfortunately, it keeps changing from 192.168.42.XXX dynamically!
One thing I noticed between Raspbian and Gentoo on Pi is that the dhcpcd.conf file is empty on the former, but contains many entries in the latter.
Anyone know how to get the IP to stick in Gentoo?
Re: Problems setting static IP address
I just right click on the "NetworkManager" applet, "Edit Connections," and set up my wired connection with a static IP address there.
This seems to make stuff in /etc/NetworkManager/system-connections instead of messing with /etc/dhcpcd.conf. Maybe you should give the NetworkManager applet a try?
This seems to make stuff in /etc/NetworkManager/system-connections instead of messing with /etc/dhcpcd.conf. Maybe you should give the NetworkManager applet a try?
Re: Problems setting static IP address
Hi gilius,
as K9spud notes, using the NetworkManager applet is probably the easiest way to achieve what you want here.
You can also use the nmcli tool to configure a fixed IP address for an interface from the command line. For some simple examples of its use, please see this script.
hth, sakaki
as K9spud notes, using the NetworkManager applet is probably the easiest way to achieve what you want here.
You can also use the nmcli tool to configure a fixed IP address for an interface from the command line. For some simple examples of its use, please see this script.
hth, sakaki
Re: Problems setting static IP address
Have you rebooted the Pi or reloaded dhcpcd after setting the static IP?
Sometimes the router won't let go of the old IP assignment until lease times out. A way to speed this is up is to temporarily also set the static IP in the router, reboot the Pi, check the ip (sometimes it takes a few minutes to change over), then remove the static IP from the router. Don't leave the static IP set up in the router and the IP at the same time, they tend to have an argument when it comes to renew the lease.
I'm sure there are better ways but I know this works for me so I use it.
Sometimes the router won't let go of the old IP assignment until lease times out. A way to speed this is up is to temporarily also set the static IP in the router, reboot the Pi, check the ip (sometimes it takes a few minutes to change over), then remove the static IP from the router. Don't leave the static IP set up in the router and the IP at the same time, they tend to have an argument when it comes to renew the lease.
I'm sure there are better ways but I know this works for me so I use it.
Jump to
- Community
- General discussion
- Announcements
- Other languages
- Deutsch
- Español
- Français
- Italiano
- Nederlands
- 日本語
- Polski
- Português
- Русский
- Türkçe
- User groups and events
- Raspberry Pi Official Magazine
- Using the Raspberry Pi
- Beginners
- Troubleshooting
- Advanced users
- Assistive technology and accessibility
- Education
- Picademy
- Teaching and learning resources
- Staffroom, classroom and projects
- Astro Pi
- Mathematica
- High Altitude Balloon
- Weather station
- Programming
- C/C++
- Java
- Python
- Scratch
- Other programming languages
- Windows 10 for IoT
- Wolfram Language
- Bare metal, Assembly language
- Graphics programming
- OpenGLES
- OpenVG
- OpenMAX
- General programming discussion
- Projects
- Networking and servers
- Automation, sensing and robotics
- Graphics, sound and multimedia
- Other projects
- Media centres
- Gaming
- AIY Projects
- Hardware and peripherals
- Camera board
- Compute Module
- Official Display
- HATs and other add-ons
- Device Tree
- Interfacing (DSI, CSI, I2C, etc.)
- Keyboard computers (400, 500, 500+)
- Raspberry Pi Pico
- General
- SDK
- MicroPython
- Other RP2040 boards
- Zephyr
- Rust
- AI Accelerator
- AI Camera - IMX500
- Hailo
- Software
- Raspberry Pi OS
- Raspberry Pi Connect
- Raspberry Pi Desktop for PC and Mac
- Beta testing
- Other
- Android
- Debian
- FreeBSD
- Gentoo
- Linux Kernel
- NetBSD
- openSUSE
- Plan 9
- Puppy
- Arch
- Pidora / Fedora
- RISCOS
- Ubuntu
- Ye Olde Pi Shoppe
- For sale
- Wanted
- Off topic
- Off topic discussion