Open ujvaritamas opened 3 months ago
used software: raspberry pi imager
sudo nano /etc/dhcpcd.conf
interface eth0
static ip_address=192.168.1.2/24
static routers=192.168.1.1
static domain_name_servers=8.8.8.8 8.8.4.4
sudo service dhcpcd restart
ifconfig eth0
ping 192.168.1.2
# Example configuration file for dhcpcd.
# See dhcpcd.conf(5) for details.
# 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
# Use the hardware address of the interface for the Client ID.
clientid
# Persist interface configuration when dhcpcd exits.
persistent
# Rapid commit support.
option rapid_commit
# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU.
# Some interface drivers reset when changing the MTU so disabled by default.
#option interface_mtu
# A ServerID is required by RFC2131.
require dhcp_server_identifier
# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private
# Example static IP configuration:
interface eth0
static ip_address=192.168.1.10/24
static routers=192.168.1.1
static domain_name_servers=8.8.8.8 8.8.4.4
# It is possible to fall back to a static IP if DHCP fails:
# define static profile
#profile static_eth0
#static ip_address=192.168.1.10/24
#static routers=192.168.1.1
#static domain_name_servers=8.8.8.8 8.8.4.4
# fallback to static profile on eth0
#interface eth0
#fallback static_eth0
ubuntu server: /etc/netplan/
network:
version: 2
ethernets:
eth0:
addresses:
- 192.168.1.10/24
gateway4: 192.168.1.1
nameservers:
addresses:
- 8.8.8.8
- 8.8.4.4
sudo netplan apply
Ubuntu desktop Configure IP Settings:
Go to the IPv4 tab. Change the Method dropdown to Manual if you want to set a static IP address. Enter your static IP address, netmask, gateway, and DNS servers: Address: 192.168.1.100 Netmask: 255.255.255.0 (or /24) Gateway: 192.168.1.1 DNS: 8.8.8.8, 8.8.4.4 (or your preferred DNS servers)
nmcli con show
sudo systemctl restart NetworkManager
ip addr show eth0
Install latest ubuntu to the pis