system: add network note

This commit is contained in:
FollieHiyuki 2021-06-18 21:39:01 +03:00
parent 657c371abe
commit 0e5f88739f
No known key found for this signature in database
GPG Key ID: 813CF484F4993419
6 changed files with 75 additions and 2 deletions

18
system/README.md Normal file
View File

@ -0,0 +1,18 @@
# System notes
## Networking
To setup networking without any network managers, dhcp client, etc.
```
# Add an address
ip address add 192.168.0.120/24 broadcast + dev eth0
# Add a route
ip route add default via 192.168.0.1 dev eth0
#or s|default|192.168.0.0/24|
# Set up DNS in /etc/resolv.conf
# nameserver 192.168.0.1
# nameserver 8.8.8.8
```

View File

@ -3,6 +3,6 @@
[General] [General]
AllowHostnameUpdates=false AllowHostnameUpdates=false
AllowDomainnameUpdates = false AllowDomainnameUpdates=false
PreferredTechnologies=ethernet,wifi PreferredTechnologies=ethernet,wifi
SingleConnectedTechnology=true SingleConnectedTechnology=true

20
system/etc/dhcpcd.conf Normal file
View File

@ -0,0 +1,20 @@
# Typical config for static IP with dhcpcd
# https://wiki.archlinux.org/title/Dhcpcd
interface eth0
static ip_address=192.168.0.10/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1 8.8.8.8
# ------------------------------------------ #
# To setup fallback profile:
#
# define static profile
# profile static_eth0
# static ip_address=192.168.1.23/24
# static routers=192.168.1.1
# static domain_name_servers=192.168.1.1
#
# fallback to static profile on eth0
# interface eth0
# fallback static_eth0

18
system/etc/iwd/main.conf Normal file
View File

@ -0,0 +1,18 @@
# Start dhcpcd service on a specified interface, eg. `dhcpcd -B eth0`
# so that it doesn't interfere with iwd's own dhcp client
[General]
EnableNetworkConfiguration=true
UseDefaultInterface=true
# Only use this when the specified config for the interface has
# `AlwaysRandomizeAddress=true` in it,
# eg. /var/lib/iwd/mywifi.psk
#AddressRandomization=true
[Network]
RoutePriorityOffset=200
EnableIPv6=true
NameResolvingService=resolvconf
[Scan]
DisablePeriodicScan=true

View File

@ -0,0 +1,17 @@
# Alpine Linux dhcp configuration for static IP
# Also manually set DNS in /etc/resolv.conf
# eg.
# nameserver 192.168.0.1
# nameserver 8.8.8.8
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.0.147
netmask 255.255.255.0
gateway 192.168.0.1
# For default dynamic IP address
#auto eth0
#iface eth0 inet dhcp

View File

@ -2,7 +2,7 @@
# Lock before suspend integration with elogind # Lock before suspend integration with elogind
username=follie username=[username]
export XAUTHORITY="/run/user/1000/Xauthority" export XAUTHORITY="/run/user/1000/Xauthority"
export DISPLAY=":0" export DISPLAY=":0"
case $1/$2 in case $1/$2 in