😁Installation 3VM


Configuration

Debian11- Router

Use RootUser

sudo -i

Change the IP Address According to Topology

nano /etc/network/interfaces

# The loopback network interface
auto ens33
iface ens33 inet static
    address 10.1.1.10
    netmask 255.255.255.0
    gateway 10.1.1.2
    
auto ens36
iface ens36 inet static
    address 20.1.1.1
    netmask 255.255.255.0
    
auto ens37
iface ens37 inet static
    address 30.1.1.1
    netmask 255.255.255.0

Restart Networking

/etc/init.d/networking restart

Update Repository Package

The purpose of the apt update command is to download for each package source the appropriate Packages (or Sources ) file and remove old versions of installed or upgradeable packages on the system that are no longer needed when upgrading.

apt update && apt upgrade -y

Install Package

apt install net-tools
apt install iptables-persistent
apt install netfilter-persistent
apt install ssh
apt install isc-dhcp-server

Configuration

NAT Gateway

We will configure the router so that it can share IP and Internet with clients.

nano /etc/sysctl.conf

Replacing on line:
net.ipv4.ip_forward=0
become
net.ipv4.ip_forward=1

nano /proc/sys/net/ipv4/ip_forward

change
0
become
1
iptables -t nat -A POSTROUTING -o ens33 -j MASQUERADE

Save the iptables configuration

iptables-save
netfilter-persistent save

SSH

The function of SSH is as a safe and reliable data transfer medium that can be used remotely. If you have used remote login applications such as Telnet before, SSH is a safer replacement application thanks to its secure shell technology.

nano /etc/ssh/sshd_config

#LoginGraceTime 2m
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

Restart SSH Service

/etc/init.d/ssh restart

DHCP Server

DHCP is the abbreviation of Dynamic Host Configuration Protocol. DHCP is a protocol used for dynamic distribution of IP addresses on computer networks. By using DHCP you can configure the IP address on each device on the computer network automatically.

nano /etc/dhcp/dhcpd.conf

# A slightly different configuration for an internal subnet.
subnet 30.1.1.0 netmask 255.255.255.0 {
  range 30.1.1.30 30.1.1.60;
  option domain-name-servers ns1.internal.example.org;
  option domain-name "internal.example.org";
  option routers 30.1.1.1;
  option broadcast-address 30.1.1.255;
  default-lease-time 600;
  max-lease-time 7200;
}

Next, we will determine which port we will provide this DHCP Server service to. Because I will provide services for Windows, I will use the ens37 interface as the port that will be provided to the DHCP Server

nano /etc/default/isc-dhcp-server

INTERFACESv4="ens37"
INTERFACESv6=""

Restart DHCP Server

systemctl restart isc-dhcp-server

Debian11- Server

Before that, we have to change the Server IP according to the segment we have created. To change the IP address we must use the root user. If you are already in the root user, then we type command

sudo -i

Change the IP Address According to Topology

nano /etc/network/Interfaces

# The loopback network interface
auto ens33
iface ens33 inet static
    address 20.1.1.20
    netmask 255.255.255.0
    gateway 20.1.1.1

Restart Networking

/etc/init.d/networking restart

Update Package

The purpose of the apt update command is to download for each package source the appropriate Packages (or Sources ) file and remove old versions of installed or upgradeable packages on the system that are no longer needed when upgrading.

apt update && apt upgrade -y

Install Package

apt install ssh

Configuration

SSH

nano /etc/ssh/sshd_config

#LoginGraceTime 2m
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

Restart SSH Service

/etc/init.d/ssh restart

Windows- Client

For Windows there is no special configuration because you already get a DHCP Server from the Router side. We only add Google's DNS so we can connect to the internet which will be used to install the required packages. The DNS are 8.8.8.8 and 8.8.4.4. The packages that will be used later are:

  • Putty

  • Filezilla

  • Web Browser

  • Command Prompt


Addition Content!

In addition, we will configure SSH on the Router side to the Server. Ssh-keygen is a tool for generating new authentication key pairs for SSH. These key pairs are used to automate logins, single sign-on, and to authenticate hosts.

Server

ssh-keygen

Host

ssh-copy-id -i /root/.ssh/id_rsa.pub [email protected]
yes
(enter the password)

Last updated