User Tools

Site Tools


настройка_стендов_слушателей

This is an old revision of the document!


Настройка стендов слушателей

Настройка виртуальных систем Unix

  • Адаптер 1 - eth0/em0 - “Внутренняя сеть” или “Виртуальный адаптер хоста” (уточните у преподавателя)
  • Адаптер 2 - eth1/em1 - Сетевой мост

Общие файлы конфигурации

Debian/Ubuntu/FreeBSD

# cat /etc/hosts
127.0.0.1               localhost

#192.168.X.1 gate.corpX.un gate
#192.168.X.10 server.corpX.un server
#192.168.X.30 client1.corpX.un client1
#192.168.100+X.10 lan.corpX.un lan

172.16.1.254           proxy
172.16.1.254           rep
# cat /etc/resolv.conf
search corpX.un
nameserver 172.16.1.254

Debian/Ubuntu

Gate

root@localhost:~# cat /etc/hostname
gate.corpX.un
root@localhost:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 192.168.X.1
        netmask 255.255.255.0

auto eth1
iface eth1 inet static
        address 172.16.1.X
        netmask 255.255.255.0
        gateway 172.16.1.254
root@localhost:~# cat /etc/sysctl.conf
...
net.ipv4.ip_forward = 1
...
root@localhost:~# init 6

...

root@gate:~# apt update

Server

root@localhost:~# cat /etc/hostname
server.corpX.un
root@localhost:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 192.168.X.10
        netmask 255.255.255.0
        gateway 192.168.X.1
root@localhost:~# init 6

...

root@server:~# apt update

FreeBSD

Gate

# cat /etc/rc.conf
hostname="gate.corpX.un"
ifconfig_em0="192.168.X.1/24"
ifconfig_em1="172.16.1.X/24"
defaultrouter=172.16.1.254
gateway_enable=yes

keyrate="fast"
sshd_enable=yes
# init 6

# pkg update -f

# pkg install pkg

Server

# cat /etc/rc.conf
hostname="server.corpX.un"
ifconfig_em0="192.168.X.10/24"
defaultrouter=192.168.X.1

keyrate="fast"
sshd_enable=yes
# init 6

# pkg update -f

# pkg install pkg

Дополнительные материалы

cat gate.sh
rm /etc/udev/rules.d/70-persistent-net.rules

cat > /etc/hosts <<EOF
127.0.0.1               localhost

192.168.${1}.1 gate.corp${1}.un gate

172.16.1.254           proxy
172.16.1.254           rep
EOF

cat > /etc/resolv.conf <<EOF
search corp${1}.un
nameserver 172.16.1.254
EOF

echo gate.corp${1}.un > /etc/hostname

cat > /etc/network/interfaces <<EOF
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 192.168.${1}.1
        netmask 255.255.255.0

auto eth1
iface eth1 inet static
        address 172.16.1.${1}
        netmask 255.255.255.0
        gateway 172.16.1.254
EOF

echo net.ipv4.ip_forward = 1 >> /etc/sysctl.conf
cat server.sh
rm /etc/udev/rules.d/70-persistent-net.rules

cat > /etc/hosts <<EOF
127.0.0.1               localhost

192.168.${1}.10 server.corp${1}.un server

172.16.1.254           proxy
172.16.1.254           rep
EOF

cat > /etc/resolv.conf <<EOF
search corp${1}.un
nameserver 172.16.1.254
EOF

echo server.corp${1}.un > /etc/hostname

cat > /etc/network/interfaces <<EOF
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 192.168.${1}.10
        netmask 255.255.255.0
        gateway 192.168.${1}.1
EOF
настройка_стендов_слушателей.1512369560.txt.gz · Last modified: 2017/12/04 09:39 by val