Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux_router:network [2023-06-18 Sun wk24 21:01] – [Debian / Ubuntu Network - Interface Setup] baumkplinux_router:network [2023-07-08 Sat wk27 10:13] (current) – [Debian / Ubuntu Network - Interface Setup] baumkp
Line 19: Line 19:
   # This file describes the network interfaces available on your system   # This file describes the network interfaces available on your system
   # and how to activate them. For more information, see interfaces(5).   # and how to activate them. For more information, see interfaces(5).
-  source /etc/network/interfaces.d/*+   
 +  source /etc/network/interfaces.d/* 
 +  
   # The loopback network interface   # The loopback network interface
   auto lo   auto lo
Line 25: Line 27:
  
   # The WAN network interface   # The WAN network interface
-  auto eno1 +  auto eno1 eno1:0 
-  iface eno1 inet static +  iface eno1 inet dhcp 
-    # set up ip address to access modem web page on WAN NIC +  # dhcp for IP/DHCP WAN (static? for PPPOE) 
 +  # set up static ip address to access modem web page on WAN NIC  
 +  iface eno1:0 inet static
     address 192.168.5.2/24     address 192.168.5.2/24
-    # broadcast 192.168.5.255 #is this require any more? 
   
   # Then LAN networks are eno2 eno3 eno4 in bridged mode br1   # Then LAN networks are eno2 eno3 eno4 in bridged mode br1
   # on the 192.168.1.1 subnet   # on the 192.168.1.1 subnet
-  auto br1 +  auto br0 
-  iface br1 inet static+  iface br0 inet static
     bridge_ports eno2 eno3 eno4     bridge_ports eno2 eno3 eno4
     address 192.168.1.1/24     address 192.168.1.1/24
-    #network 192.168.1.0 #is this require any more? +    dns-nameservers 192.168.1.14 192.168.1.2 9.9.9.9
-    #netmask 255.255.255.0 #is this require any more? +
-    #broadcast 192.168.1.255 #is this require any more? +
-    dns-nameservers 192.168.1.1+
     bridge_stp off  # disable Spanning Tree Protocol     bridge_stp off  # disable Spanning Tree Protocol
     #bridge_fd 9  # forwarding delay  # use default?     #bridge_fd 9  # forwarding delay  # use default?
Line 66: Line 66:
 Each Ethernet hardware connection has its own defined unique MAC number, no need to define another. If Ethernet bonding were being used there maybe a need to use this stanza. Each Ethernet hardware connection has its own defined unique MAC number, no need to define another. If Ethernet bonding were being used there maybe a need to use this stanza.
   #hwaddress ether xx:xx:xx:xx:xx:xx   #hwaddress ether xx:xx:xx:xx:xx:xx
 +
 +The "modern" way to specify static ip address as address 192.168.1.0/24'' this automatically assigns the network, netmask and broadcast addresses.
 +
 +The old fashion way was to manual assign as follows:
 +address 192.168.1.32
 +network 192.168.1.0
 +netmask 255.255.255.0
 +broadcast 192.168.1.255
 +Perhaps this is still required in special cases?
 +
 </code> </code>
 ++++ ++++
Line 250: Line 260:
 </code> ++++ </code> ++++
 Currently Ubuntu (20.04) defaults to netplan.io, where as Debian 10 does not. So in Debian the ''/etc/network/interfaces'' need to be disabled, if using netplan. Where as in Ubuntu the auto configuration needs to be disabled. Currently Ubuntu (20.04) defaults to netplan.io, where as Debian 10 does not. So in Debian the ''/etc/network/interfaces'' need to be disabled, if using netplan. Where as in Ubuntu the auto configuration needs to be disabled.
 +
 +I am using Debian 12 now and am moving back to /etc/network/interfaces for network configuration.  As the DHCP and DNS server now run in a VM/Docker containers, this simplifies settings on the main router functions. 
  
 I wrote 2 scripts to switch between configuration: I wrote 2 scripts to switch between configuration:
 ++++ ''vim tononrouter.sh'' | ++++ ''vim tononrouter.sh'' |
 <code> <code>
-systemctl disable bind9 +#systemctl disable bind9 
-systemctl disable isc-dhcp-server +#systemctl disable isc-dhcp-server 
-mv /etc/netplan/50-cloud-init.yaml.old /etc/netplan/50-cloud-init.yaml +#systemctl disable nftables 
-mv /etc/netplan/network.yaml /etc/netplan/network.yaml.old+#systemctl disable pppoe 
 +#mv /etc/netplan/50-cloud-init.yaml.old /etc/netplan/50-cloud-init.yaml 
 +#mv /etc/netplan/network.yaml /etc/netplan/network.yaml.old 
 +ln -sf /etc/nftables.conf.orig /etc/nftables.conf 
 +#ln -sf /etc/nftables.conf.router /etc/nftables.conf 
 +ln -sf /etc/network/interfaces.orig /etc/network/interfaces 
 +#ln -sf /etc/network/interfaces.router /etc/network/interfaces
 </code> ++++ </code> ++++
  
Line 264: Line 282:
 ++++ ''vim torouter.sh'' | ++++ ''vim torouter.sh'' |
 <code> <code>
-systemctl enable bind9 +#systemctl enable bind9 
-systemctl enable isc-dhcp-server +#systemctl enable isc-dhcp-server 
-mv /etc/netplan/50-cloud-init.yaml /etc/netplan/50-cloud-init.yaml.old +#systemctl enable nftables 
-mv /etc/netplan/network.yaml.old /etc/netplan/network.yaml+#systemctl enable pppoe 
 +#mv /etc/netplan/50-cloud-init.yaml  /etc/netplan/50-cloud-init.yaml.old 
 +#mv /etc/netplan/network.yaml.old  /etc/netplan/network.yaml 
 +#mv /etc/netplan/50-cloud-init.yaml.old /etc/netplan/50-cloud-init.yaml 
 +#mv /etc/netplan/network.yaml /etc/netplan/network.yaml.old 
 +#ln -sf /etc/nftables.conf.orig /etc/nftables.conf 
 +ln -sf /etc/nftables.conf.router /etc/nftables.conf 
 +#ln -sf /etc/network/interfaces.orig /etc/network/interfaces 
 +ln -sf /etc/network/interfaces.router /etc/network/interfaces 
 </code> ++++ </code> ++++
 Use ''sudo bash tonrouter.sh'' to move to non router configuration. Use ''sudo bash tonrouter.sh'' to move to non router configuration.