Here you go:
Code: Select all
## define static profile
profile static_eth0
static ip_address=192.168.0.6/24
static routers=192.168.0.201
static domain_name_servers=192.168.0.201
## fallback to static profile on eth0
interface eth0
fallback static_eth0
Other default options from dhcpcd.conf:
Code: Select all
hostname
clientid
persistent
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option ntp_servers
require dhcp_server_identifier
slaac private
nohook lookup-hostname
But all this might be unnecessary as dhcpcd should automatically switch to IPv4LL (local-link as mentioned by Milliways) if it doesn't receive an answer from a dhcp server within the default timeout (30 seconds I believe). To simulate that while connected to your lan served by a dhcp server, just blacklist that dhcp server (router?) and shorten the timeout with:
Code: Select all
# blacklist dhcp router address
blacklist 192.168.0.201/24
# shorten timeout
timeout 3
After any change in the dhcpcd.conf file, don't forget to rebind your interface with systemctl or dhcpcd -n as in my post above.