Debian Router - Network Interfaces Configuration

Updated:2020-01-14
Share:
In preparation of using debian as a router, We''ll configure network interfaces, after performing initial setup.
 
 
In this debian router articles series also:
  1. Introduction.
  2. Hardware Requirements.
  3. Software installation.
  4. Basic Setup.
  5. /etc/network/Interfaces Configuration. (We are Here!)
  6. Unbound dns server setup.
  7. DHCP server setup.
  8. Squid setup.
  9. Final step iptables and sysctl.conf configuration.

 

We''ll modify /etc/network/interfaces for setting up the network, as said previously eth0, eth1 are used for KISS sake only.
 
Lets start our network interfaces automatically after boot, add the folowing:
# automatic start the following interfaces:
auto eth0 eth1
 
If you use usb ethernet cards, then its helpful to start/stop interfaces  whenever you plug/unplug usb cards, then add the following:
# usb interfaces support for plug/unplug:
allow-hotplug eth0 eth1
 
eth0 is the primary ethernet get its internet/wan ip address from WAN-AP so add the following:
# primary ethernet (connected to the WAN-AP)
iface eth0 inet dhcp
 
eth1 is the secondary ethernet connected to LAN-AP, we need to assign it a static ip address by our DHCP server, add the following:
# secondery ethernet (connected to LAN-AP)
iface eth1 inet static
address 10.5.5.1 netmask 255.255.255.0
network 10.5.5.0
broadcast 10.5.5.255
gateway 10.5.5.1
 
 
After applying these changes your /etc/network/interfaces may will look similar to the following:
 
# The loopback network interface:
iface lo inet loopback
# automatic start the following interfaces:
auto lo eth0 eth1

# usb interfaces support for plug/unplug
allow-hotplug eth0 eth1

# primary ethernet (connected to the WAN-AP)
iface eth0 inet dhcp

# secondery ethernet (connected to LAN-AP)
iface eth1 inet static
address 10.5.5.1
netmask 255.255.255.0
network 10.5.5.0
broadcast 10.5.5.255
gateway 10.5.5.1
 
 

Read also

Debian Router - Iptables And Sysctl.Conf Configuration

Tody we''ll finish configuring our awesome router, in the previous article we''d configured squid proxy, in this article we''ll pass all LAN traffic through squid using iptables.    In this debian router articles series also: Introduction . Hardware Requirements . Software installation . Basic Setup . /etc/network/Interfaces Configuration . Unbound dns server setup . DHCP server setup .  Squid setup .  Final step iptables a...

Using Linux Debian As Router Setup

In this articles series you will learn how to setup Linux (Debian) as a Router for home/business local networks, to spice things I''ll show how to add dns server, proxy/web caching server, and basic web traffic filter to our cute debian box.   In this series I''ll go over: Introduction . Hardware Requirements . Software installation . Basic Setup . /etc/network/Interfaces Configuration . Unbound dns server setup . DHCP server setup . Squid setup. ...

Debian Router - Dhcp Server Setup

We''ve learned  previously  how to set up unbound dns server as caching dns server for our LAN users, in this article we''ll configure dhcp server from which a unique ip address for each client assigned as a bonus automatically configure dns server settings for them.     In this debian router articles series also: Introduction . Hardware Requirements . Software installation . Basic Setup . /etc/network/Interfaces Configuration . Unboun...

Debian Router - Unbound Dns Server Setup

In the previous article we''ve configured network interfaces, so by now debian box is connected to internet through WAN-AP on eth0 and to local network through LAN-AP on eth1. Today we''ll setup unbound dns server to serve dns queries for our awesome LAN clients.     In this debian router articles series also: Introduction . Hardware Requirements . Software installation . Basic Setup . /etc/network/Interfaces Configuration . Unbound dns server...

Debian Router - Squid Setup

We''ve configured the dhcp server , so what''s for today?! Today we''ll configure Squid for caching web traffic and access control.     In this debian router articles series also: Introduction . Hardware Requirements . Software installation . Basic Setup . /etc/network/Interfaces Configuration . Unbound dns server setup . DHCP server setup .  Squid setup . ( We are Here! ) Final step iptables and sysctl.conf configuration ...