LX-INL-INFO-net-mint
updated oct/20/2014 16:02
Manuele netwerkconfig Linux Mint 17
-
avahi-daemon en NetworkManager
De avahi-daemon en network-manager zijn services die automatisch het netwerk configureren. Die hebben een grafische user interface, wanneer je rechts klikt op het pictogram van het network in de taakbalk.
Als we echter van Linux Mint een server willen maken, dan is het niet de bedoeling dat je eerst inlogt op de GUI en dat daarna pas je netwerkconfiguratie opkomt.
Servers zijn in principe nooit ingelogd, en worden meestal via SSH van op afstand gemonitord en geconfigureerd.
We starten een terminal en gaan naar de directory /etc/init
Daar zien we de volgende files:
$ ls
acpid.conf modemmanager.conf rc.conf
alsa-restore.conf mountall-bootclean.sh.conf rcS.conf
alsa-state.conf mountall.conf rc-sysinit.conf
alsa-store.conf mountall-net.conf reload-smbd.conf
anacron.conf mountall-reboot.conf resolvconf.conf
avahi-cups-reload.conf mountall.sh.conf rfkill-restore.conf
avahi-daemon.conf mountall-shell.conf rfkill-store.conf
mountdevsubfs.sh.conf rsyslog.conf
bluetooth.conf mounted-debugfs.conf samba-ad-dc.conf
bootmisc.sh.conf mounted-dev.conf setvtrgb.conf
checkfs.sh.conf mounted-proc.conf shutdown.conf
checkroot-bootclean.sh.conf mounted-run.conf smbd.conf
checkroot.sh.conf mounted-tmp.conf startpar-bridge.conf
console.conf mounted-var.conf systemd-logind.conf
console-font.conf mountkernfs.sh.conf tty1.conf
console-setup.conf mountnfs-bootclean.sh.conf tty2.conf
container-detect.conf mountnfs.sh.conf tty3.conf
control-alt-delete.conf mtab.sh.conf tty4.conf
cron.conf networking.conf tty5.conf
cryptdisks.conf network-interface.conf tty6.conf
cryptdisks-udev.conf network-interface-container.conf udev.conf
cups-browsed.conf network-interface-security.conf udev-fallback-graphics.conf
cups.conf network-manager.conf udev-finish.conf
dbus.conf udevmonitor.conf
dmesg.conf nmbd.conf udevtrigger.conf
failsafe.conf passwd.conf ufw.conf
flush-early-job-log.conf plymouth.conf upstart-file-bridge.conf
friendly-recovery.conf plymouth-log.conf upstart-socket-bridge.conf
gpu-manager.conf plymouth-ready.conf upstart-udev-bridge.conf
hostname.conf plymouth-shutdown.conf ureadahead.conf
hwclock.conf plymouth-splash.conf ureadahead-other.conf
hwclock-save.conf plymouth-stop.conf usb-modeswitch-upstart.conf
irqbalance.conf plymouth-upstart-bridge.conf vmware-tools.conf
kmod.conf procps.conf vmware-tools-thinprint.conf
mdm.conf pulseaudio.conf wait-for-state.conf
Om aan upstart duidelijk te maken dat we avahi-daemon en network-manager zelf willen configureren, creeren we telkens een file
met de extensie .override met daarin de opdracht "manual" (zonder quotes :-) ).
Dat kan zonder editor, door het woord manual te redirecten naar de .override-file:
$ cd /etc/init
$ sudo su
# echo manual > avahi-daemon.override
# echo manual > network-manager.override
# exit
exit
$
-
ip-address / gateway / netmask / DNS-server
We moeten vervolgens de netwerkconfiguratie in een config-file plaatsen.
Pas de file /etc/network/interfaces als volgt aan:
# pico /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.xx.yy
netmask 255.255.255.0
gateway 192.168.xx.zz
dns-nameservers 8.8.8.8
|
-
Herstart je computer
-
Test je ip-adres
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:60:08:56:b6:bf
inet addr:172.16.44.45 Bcast:172.16.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:739244 errors:0 dropped:0 overruns:0 frame:0
TX packets:147347 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:191700558 (182.8 MB) TX bytes:66834778 (63.7 MB)
Interrupt:19 Base address:0xb800
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:127 errors:0 dropped:0 overruns:0 frame:0
TX packets:127 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:102236 (99.8 KB) TX bytes:102236 (99.8 KB)
-
Test je router
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0
172.16.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 172.16.0.2 0.0.0.0 UG 100 0 0 eth0
-
Test je DNS
# ping google.be
PING google.be (74.125.79.99) 56(84) bytes of data.
64 bytes from ey-in-f99.1e100.net (74.125.79.99): icmp_seq=1 ttl=50 time=28.3 ms
64 bytes from ey-in-f99.1e100.net (74.125.79.99): icmp_seq=2 ttl=50 time=27.5 ms
of
# dig
; <<>> DiG 9.4.2-P2 <<>>
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43971
;; flags: qr rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 9
;; QUESTION SECTION:
;. IN NS
;; ANSWER SECTION:
. 16259 IN NS b.root-servers.net.
. 16259 IN NS e.root-servers.net.
. 16259 IN NS c.root-servers.net.
. 16259 IN NS m.root-servers.net.
. 16259 IN NS j.root-servers.net.
. 16259 IN NS i.root-servers.net.
. 16259 IN NS k.root-servers.net.
. 16259 IN NS f.root-servers.net.
. 16259 IN NS a.root-servers.net.
. 16259 IN NS d.root-servers.net.
. 16259 IN NS h.root-servers.net.
. 16259 IN NS l.root-servers.net.
. 16259 IN NS g.root-servers.net.
;; ADDITIONAL SECTION:
b.root-servers.net. 68485 IN A 192.228.79.201
m.root-servers.net. 49414 IN A 202.12.27.33
j.root-servers.net. 16259 IN A 192.58.128.30
i.root-servers.net. 16259 IN A 192.36.148.17
k.root-servers.net. 16259 IN A 193.0.14.129
f.root-servers.net. 16259 IN A 192.5.5.241
a.root-servers.net. 16259 IN A 198.41.0.4
d.root-servers.net. 16259 IN A 128.8.10.90
h.root-servers.net. 16259 IN A 128.63.2.53
;; Query time: 16 msec
;; SERVER: 172.16.0.101#53(172.16.0.101)
;; WHEN: Tue Aug 10 20:14:51 2010
;; MSG SIZE rcvd: 385