Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ==== ubuntu and variants ==== * give priority to Wi-Fi over Ethernet for Internet connections: ''Wired Connection'' -> ''IPv4 Settings'' -> ''Routes'' -> ''Use this connection only for resources on its network.'' ([[https://askubuntu.com/questions/424474/how-can-i-give-internet-priority-to-wifi-instead-of-ethernet|source]]) * check speed of NIC: ''cat /sys/class/net/<interface>/speed'' * check bandwidth of what is being sent in realtime with ''nethogs''. Add the ''-C'' option to ''nethogs'' to see both UDP and TCP (shows only TCP by default) ===== Netplan ===== ''Netplan'' is a front end for ''systemd-networkd'' * restarting netplan: ''systemd restart systemd-networkd.service'' * try and optionally use a new netplan config: ''netplan try'' * configuration are YAML files that go inside ''/etc/netplan'' * in the config file choose ''Network Manager'' as renderer for GUI, or ''networkd'' to configure inside the YAML file * [[https://netplan.readthedocs.io/en/stable/examples/|example configurations]] * [[https://netplan.readthedocs.io/en/stable/netplan-yaml/|netplan official documentation]] ==== Example Netplan yaml file to create a bridge ==== <code> network: version: 2 renderer: networkd ethernets: enp1s0: dhcp4: no eno1: dhcp4: no enxf8e43b6c9b8c: dhcp4: true bridges: br2: dhcp4: no addresses: - 10.42.0.1/24 interfaces: - enp1s0 - eno1 </code> With this configuration you can treat br2 as if it were a real physical interface (run a DHCP server on it, etc.) ===== Sharing Internet with an interface ===== * configure the userspace to allow ipv4 forwarding: * temporary: ''sudo echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward'' * persistant: change setting in ''/etc/sysctl.conf'' * assuming ''enxf8e43b6c9b8c'' connects to the internet and ''br2'' is the interface you wish to share internet with <code> #iptables -t nat -A POSTROUTING -o enxf8e43b6c9b8c -j MASQUERADE #iptables -A FORWARD -i enxf8e43b6c9b8c -o br2 -m state --state RELATED,ESTABLISHED -j ACCEPT #iptables -A FORWARD -i br2 -o enxf8e43b6c9b8c -j ACCEPT </code> * install ''iptables-persistent'' to retain iptables rules on reboot. === Configure isc-dhcp-server === * inside ''/etc/default/isc-dhcp-server'' set the interface. * Assuming interface for dhcp server will be br2: ''INTERFACESv4="br2"'' * configuration goes inside ''/etc/dhcp/dhcpd.conf'' * Assuming interface for DHCP server is at 10.42.0.1, example config: <code> ddns-update-style none; authoritative; default-lease-time 600; max-lease-time 7200; subnet 10.42.0.0 netmask 255.255.255.0 { range 10.42.0.50 10.42.0.254; option routers 10.42.0.1; option domain-name-servers 8.8.8.8, 8.8.4.4; } </code> lwc/networking/start.txt Last modified: 2023/10/27 10:07by 127.0.0.1