Sunday 18 February 2024

Configure Pi OS to use a static IPv4 Address

To configure Pi OS to use a static IPv4 address on the wired interface use the following commands:

sudo nmcli connection modify 'Wired connection 1' ipv4.address 192.168.200.20/24

This sets the (first) wired interface's IPv4 address to 192.168.200.20 with a net mask of 255.255.255.0.

sudo nmcli connection modify 'Wired connection 1' ipv4.method manual

This sets the (first) wired interface's IPv4 address to be manually set.

sudo nmcli connection modify 'Wired connection 1' ipv4.dns 192.168.200.10

This sets the (first) wired interface's IPv4 DNS server address to be 192.168.200.10.

sudo nmcli connection down 'Wired connection 1' ;sudo nmcli connection up 'Wired connection 1'

This resets the (first) wired interface by taking the connection down and the reestablishing it.

No comments:

Post a Comment