Update 2023-11-06 11:24:10

This commit is contained in:
c0dev0id 2023-11-06 11:24:12 +01:00
parent 7b5408c8c9
commit d1776c487e

View File

@ -10,7 +10,7 @@ List available network devices and configuration
ifconfig
```
Typical ethernet devices are "em0", "bge0", "re0". Look at the manpage of "[em(4)](https://man.openbsd.org/em.4)", "[bge(4)](https://man.openbsd.org/bge.4)" or any other device you might find to learn about what it is.
Typical ethernet devices are `em0`, `bge0`, `re0`. Look at the manpage of "[em(4)](https://man.openbsd.org/em.4)", "[bge(4)](https://man.openbsd.org/bge.4)" or any other device you might find to learn about what it is.
You can configure these devices with
@ -40,7 +40,7 @@ ifconfig em0 up
## Manuel Wireless Device Setup
Typical wireless devices are "run0", "iwx0", "iwn0", "iwm0". They have manpages as well look up the device name without number.
Typical wireless devices are `run0`, `iwx0`, `iwn0`, `iwm0`. They have manpages as well look up the device name without number.
You connect a wireless device to your network without
@ -67,16 +67,16 @@ Most confgurations can be removed this way.
## Setting the configuration active without restarting
If you changed the /etc/hostname.* files, you can reconfigure the network with the netstart shell script
If you changed the `/etc/hostname.*` files, you can reconfigure the network with the netstart shell script
```
sh /etc/netstart
```
Note that this script adds the confguration to devices as specified. If you remove a /etc/hostname.* file, netstart will not know about this device and ignore it.
Note that this script adds the confguration to devices as specified. If you remove a `/etc/hostname.*` file, netstart will not know about this device and ignore it.
## Makeing the configuration permanent
## Making the configuration permanent
The concept of storing the network device setup is decribed in the manpage [hostname.if(5)](https://man.openbsd.org/hostname.if.5).
@ -91,9 +91,9 @@ inet6 autoconf
up
```
You may recognise these commands from the manual configuration. The file is named "hostname.<device>" and it basically contains the ifconfig commands that you can also add after "ifconfig <device>".
You may recognise these commands from the manual configuration. The file is named `hostname.<device>` and it basically contains the ifconfig commands that you can also add after `ifconfig <device>`.
Note that I added two "join" commands here instead of "nwid". The difference is, that "nwid" connects to exactly one wifi network, while "join" builds up a list of multiple networks that are tried in order. If you only have one network to connect to, it makes no difference if you use "nwid" or "join".
Note that I added two `join` commands here instead of `nwid`. The difference is, that `nwid` connects to exactly one wifi network, while `join` builds up a list of multiple networks that are tried in order. If you only have one network to connect to, it makes no difference if you use "nwid" or "join".
You can clear the join list just like you can remove any other configuration from a device.
@ -101,7 +101,7 @@ You can clear the join list just like you can remove any other configuration fro
ifconfig iwx0 -join
```
This "/etc/hostname.<device>" based configuration makes it easy to copy configuration to another device
This `/etc/hostname.<device>` based configuration makes it easy to copy configuration to another device
```
cp /etc/hostname.iwx0 /etc/hostname.run0
@ -143,5 +143,5 @@ trunkport iwx0
The fist line means that we do a failover. This means we use the fist device if we can. If the first device (master device) is down, then we use the second one.
In this concrete example it means, if a network cable is plugged in to "em0", we use this device. If the network cable is pulled, we simply continue with the wireless device "iwx0".
In this concrete example it means, if a network cable is plugged in to `em0`, we use this device. If the network cable is pulled, we simply continue with the wireless device `iwx0`.