Добавить в корзинуПозвонить
Найти в Дзене
ЭКЗАМЕНСА2

1.2

ISP: 1. Вписываем: mkdir /etc/net/ifaces/enp7s2
mkdir /etc/net/ifaces/enp7s3
ls /etc/net/ifaces/ Проверяем: cat /etc/net/ifaces/enp7s1/options 2. Вставляем: echo "TYPE=eth" > /etc/net/ifaces/enp7s2/options
echo "BOOTPROTO=static" >> /etc/net/ifaces/enp7s2/options
cp /etc/net/ifaces/enp7s2/options /etc/net/ifaces/enp7s3/options
echo "172.16.1.1/28" > /etc/net/ifaces/enp7s2/ipv4address
echo "172.16.2.1/28" > /etc/net/ifaces/enp7s3/ipv4address Применяем: systemctl restart network Проверяем: ip -c a 3. Устанавливаем: apt-get update & apt-get install iptables -y Вписываем: iptables -t nat -A POSTROUTING -o enp7s1 -j MASQUERADE
iptables-save >> /etc/sysconfig/iptables
systemctl enable --now iptables
iptables -t nat -L -n -v
sysctl -a | grep "ip_forward" echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
sysctl -p Проверяем:
ping -c3 ya.ru HQ-RTR: echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
sysctl -p ip -c a show enp7s1
ip -c r
cat /etc/resolv.conf ping -c3 ya.ru BR-RTR: echo "net.ip

ISP:

1.

Вписываем:

mkdir /etc/net/ifaces/enp7s2
mkdir /etc/net/ifaces/enp7s3
ls /etc/net/ifaces/

Проверяем:

cat /etc/net/ifaces/enp7s1/options

-2

2.

Вставляем:

echo "TYPE=eth" > /etc/net/ifaces/enp7s2/options
echo "BOOTPROTO=static" >> /etc/net/ifaces/enp7s2/options
cp /etc/net/ifaces/enp7s2/options /etc/net/ifaces/enp7s3/options
echo "172.16.1.1/28" > /etc/net/ifaces/enp7s2/ipv4address
echo "172.16.2.1/28" > /etc/net/ifaces/enp7s3/ipv4address

-3

Применяем:

systemctl restart network

-4

Проверяем: ip -c a

-5

3.

Устанавливаем: apt-get update & apt-get install iptables -y

Вписываем:

iptables -t nat -A POSTROUTING -o enp7s1 -j MASQUERADE
iptables-save >> /etc/sysconfig/iptables
systemctl enable --now iptables
iptables -t nat -L -n -v
sysctl -a | grep "ip_forward"

echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
sysctl -p

-6

Проверяем:
ping -c3 ya.ru

-7

HQ-RTR:

echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
sysctl -p

ip -c a show enp7s1
ip -c r
cat /etc/resolv.conf

ping -c3 ya.ru

-8

BR-RTR:

echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
sysctl -p

ip a
ip -c a s enp7s1
ip -c r
cat /etc/resolv.conf
ping -c3 ya.ru

-9