update debian networking instructions
This commit is contained in:
parent
802df7c3f3
commit
ee7d7ce00a
4 changed files with 79 additions and 3 deletions
77
zk/Configuring_internet_connection_on_Debian.md
Normal file
77
zk/Configuring_internet_connection_on_Debian.md
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
---
|
||||
tags: [networks, internet, Debian, linux, Ethernet]
|
||||
---
|
||||
|
||||
## Ethernet
|
||||
|
||||
First identify the name of your Ethernet interface with
|
||||
[`ip addr show`](./View_IP_addresses.md). Example output:
|
||||
|
||||
```
|
||||
enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
|
||||
link/ether 40:b0:34:37:40:40 brd ff:ff:ff:ff:ff:ff
|
||||
inet 192.168.178.53/24 brd 192.168.178.255 scope global enp1s0
|
||||
```
|
||||
|
||||
That last line is configured via `/etc/network/interfaces`. If you have not set
|
||||
this up, the top line will say `DOWN` instead of `UP` and you will not have
|
||||
internet access over Ethernet.
|
||||
|
||||
The follwing example of `/etc/network/interfaces` is a common default:
|
||||
|
||||
```
|
||||
auto enp1s0
|
||||
iface enp1s0 inet static
|
||||
address 192.168.178.49
|
||||
netmask 255.255.255.0
|
||||
gateway 192.168.178.1
|
||||
dns-nameservers 8.8.8.8 8.8.4.4
|
||||
```
|
||||
|
||||
Sets the following:
|
||||
|
||||
- connect automatically as soon as Ethernet port activated
|
||||
- use the `enp1s0` interface and insist on static IP from [DHCP](./DHCP.md)
|
||||
- use the static IP address `192.168.178.49`
|
||||
- use standard subnet masking
|
||||
- use Google as the preferred and fallback DNS
|
||||
|
||||
Restart networking:
|
||||
|
||||
```sh
|
||||
sudo systemctl restart networking
|
||||
```
|
||||
|
||||
Confirm connection again with `ip addr show` or
|
||||
`sudo systemctl status networking`.
|
||||
|
||||
## Turn the Ethernet interface on/off
|
||||
|
||||
```sh
|
||||
ifup enp1s0
|
||||
ifdown enp1s0
|
||||
```
|
||||
|
||||
### Use dynamic local IP address
|
||||
|
||||
If you don't want to use a static IP, the contents of `/etc/network/interfaces`
|
||||
is more minimal:
|
||||
|
||||
```
|
||||
auto enp1s0
|
||||
iface enp1s0 inet dhcp
|
||||
```
|
||||
|
||||
Basically you just let DHCP do the work of negotiating the IP address from the
|
||||
router.
|
||||
|
||||
## Contrast with other Linux operating systems
|
||||
|
||||
Arch uses `systemd-resolvd` and NetworkManager. You won't find
|
||||
`etc/network/interfaces`.
|
||||
|
||||
To check network status on Arch use:
|
||||
|
||||
```sh
|
||||
systemctl status NetworkManager
|
||||
```
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
---
|
||||
tags: [networks, internet]
|
||||
created: Friday, August 16, 2024
|
||||
---
|
||||
|
||||
## IPv4 vs IPv6
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
id: ippn
|
||||
tags: [networks, procedural, Linux]
|
||||
tags: [networks, procedural, Linux, dns]
|
||||
created: Monday, June 10, 2024
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -23,4 +23,4 @@ link/ether 90:2e:16:53:98:b9 brd ff:ff:ff:ff:ff:ffinet
|
|||
```
|
||||
|
||||
The most important line is the third. This indicates my IP address
|
||||
(`192.168.0.3/24`) including its subnet mask.
|
||||
(`192.168.0.3/24`) including its [subnet mask](./IP_addresses.md).
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue