Created
February 18, 2023 20:21
-
-
Save VladimirCores/36bac81352cd3ce67792267b45f47b89 to your computer and use it in GitHub Desktop.
Connect and bridge internet through ethernet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.linuxfordevices.com/tutorials/ubuntu/dhcp-server-on-ubuntu | |
# The default lease time for a client is 10 mins(600 seconds) | |
# and the maximum lease time is 2 hrs(7200 seconds). | |
default-lease-time 600; | |
max-lease-time 7200; | |
authoritative; | |
# This DHCP Server is the official server for the local network. (indicated by authoritative). | |
subnet 192.168.2.0 netmask 255.255.255.0 { | |
# The Server will hand over the IP Address from the range 192.168.1.100 to 192.168.1.200. | |
range 192.168.2.100 192.168.2.200; | |
# The server will also “advise” the client to use 192.168.1.254 as the default-gateway | |
# and 192.168.1.1 and 192.168.1.2 as its DNS servers. | |
option routers 192.168.2.254; | |
option broadcast-address 192.168.2.255; | |
option domain-name "localdomain.org"; | |
option domain-name-servers 192.168.2.1, 192.168.2.2; | |
option ip-forwarding off; | |
} | |
# Run "ip a" you will find - link/ether b0:25:aa:3a:fb:f6 | |
# This will reserve the IP Address 192.168.1.20 for the client with the MAC Address e0:91:53:31:af:ab. | |
# You may omit the Static IP Configuration part if you want to assign addresses automatically. | |
host archmachine { | |
hardware ethernet b0:25:aa:3a:fb:f6; | |
fixed-address 192.168.2.20; | |
option host-name "archmachine"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# interfaces(5) file used by ifup(8) and ifdown(8) | |
# Include files from /etc/network/interfaces.d: | |
source-directory /etc/network/interfaces.d | |
# This file describes the network interfaces available on your system | |
# and how to activate them. For more information, see interfaces(5). | |
# The loopback network interface | |
auto lo | |
iface lo inet loopback | |
# Set up interfaces manually, avoiding conflicts with, e.g., network manager | |
iface eth0 inet manual | |
iface eth1 inet manual | |
allow-hotplug eno1 | |
iface eno1 inet static | |
address 192.168.2.1 | |
netmask 255.255.255.0 | |
network 192.168.2.0 | |
broadcast 192.168.2.255 | |
gateway 192.168.2.1 | |
# Bridge setup | |
iface br0 inet dhcp | |
bridge_ports eno1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server) | |
# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf). | |
#DHCPDv4_CONF=/etc/dhcp/dhcpd.conf | |
#DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf | |
# Path to dhcpd's PID file (default: /var/run/dhcpd.pid). | |
#DHCPDv4_PID=/var/run/dhcpd.pid | |
#DHCPDv6_PID=/var/run/dhcpd6.pid | |
# Additional options to start dhcpd with. | |
# Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead | |
#OPTIONS="" | |
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests? | |
# Separate multiple interfaces with spaces, e.g. "eth0 eth1". | |
INTERFACESv4="eno1" | |
INTERFACESv6="" |
Author
VladimirCores
commented
Feb 19, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment