Testinstall

Aus Vosp.info
Wechseln zu:Navigation, Suche

Zurück zu LXC auf Ubuntu 14.04-2 LTS

Was soll es werden

  • DHCP-Server
  • Nameserver
  • Router mit Masquerading
  • tftpd-Server

Netzwerkschnittstellen

vim /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

# Ergänzung für eth1 (output interface)
auto eth1
iface eth1 inet static
        address 10.78.20.10
        netmask 255.255.255.0
systemctl restart networking.service

DHCP-Server

apt-get install isc-dhcp-server
vim /etc/default/isc-dhcp-server

Ersetze

INTERFACES=""

gegen

INTERFACES="eth1"
vim /etc/dhcp/dhcpd.conf


ddns-update-style none;
option domain-name "test.local";
option domain-name-servers 10.78.20.10;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;


subnet 10.78.20.0 netmask 255.255.255.0 {
  range 10.78.20.100 10.78.20.200;
  option routers 10.78.20.10;
}
systemctl restart isc-dhcp-server.service

Nameserver

apt-get install bind9

Für Tests (z.B. dig)

apt-get install dnsutils

Masquerading per Firewall

apt-get install iptables
vim /etc/rc.local

Einfügen vor exit 0

iptables -t nat -F
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Forwarding

vim /etc/sysctl.conf

Ersetze

#net.ipv4.ip_forward=1

durch

net.ipv4.ip_forward=1

Aktivieren

sysctl -p

tftp für PXE-Boot

vim /etc/dhcp/dhcpd.conf

next-server 10.78.20.10;
filename "linux/pxelinux.0";
systemctl restart isc-dhcp-server.service
apt-get install tftpd-hpa
vim /etc/default/tftp-hpa

Ändern von

TFTP_ADDRESS="0.0.0.0:69"

in

TFTP_ADDRESS="10.78.20.10:69"
mkdir /srv/tftp/linux

Zum schnellen testen

wget http://ftp.nl.debian.org/debian/dists/jessie/main/installer-i386/current/images/netboot/netboot.tar.gz
mv netboot.tar.gz /srv/tftp/linux/
cd /srv/tftp/linux
tar xf netboot.tar.gz
chgrp -R nogroup *

Client mit PXE als Bootdevice starten

Erstmal weglassen

apt-get install syslinux