------------------------ Week 9 Notes for NET2003 ------------------------ -Ian! D. Allen - idallen@idallen.ca Remember - knowing how to find out an answer is more important than memorizing the answer. Learn to fish! RTFM! (Read The Fine Manual) Keep up on your readings (Course Outline: average 5 hours/week homework) Linux Networking Start-Up ------------------------- BIOS executes the boot block from the first available disk drive. The boot block redirects to a bootloader program such as LILO or GRUB. LILO/GRUB allow a choice of systems to boot. Choosing a Linux kernel, the Linux kernel loads - loader can pass options to the kernel using a "kernel command line" - a copy is available as /proc/cmdline when the system is running - services can look in this command line for keywords/values - e.g. the word "single" boots Linux in single-user maintenance mode Linux kernel runs Process #1 - "init" - all subsequent processes fork/exec and are descendants of this one init runs the "rc" scripts corresponding to the default run level - see initdefault in /etc/inittab - /etc/rc?.d/* or /etc/rc.d/rc?.d/* are symlinks to /etc/init.d/* Auto-config RC scripts may probe hardware - locate drivers for discovered hardware - boot-time hardware detection scripts: kudzu, harddrake, etc. - without auto-config, you have to know what drivers match which hardware - drivers load into the running kernel using "insmod", usually called from an easier-to-use wrapper routine named "modprobe" - use command "lsmod" to see loaded drivers - use "rmmod" to remove a loaded kernel module - Note: most drivers can be compiled into the base kernel instead of loaded as modules at run time; lsmod will not show these compiled-in drivers! boot time usually executes an RC "network" start-up script - may be called /etc/init.d/network - script may load special modules (e.g. ipv6) - script may set network kernel options using sysctl - see /etc/sysctl.conf - may use helper scripts such as "ifup" and "ifdown" to start network - see files in /etc/sysconfig/ and /etc/sysconfig/network-scripts/ - each device has a config file: e.g. /etc/sysconfig/network-scripts/ifcfg-{lo,eth0,eth1} - enabling the device also adds a route for that device start-up scripts in /etc/rc?.d/ or /etc/rc.d/rc?.d/ start "daemons" - programs that listen on well-known TCP and UDP network ports - /etc/services is a local list of names of many well-known ports - see also http://www.iana.org/assignments/port-numbers major service port numbers (often seen in trace output): TCP 20 ftp-data TCP 21 ftp (control) TCP 22 SSH TCP 23 telnet TCP 25 SMTP UDP/TCP 53 domain (DNS) TCP 80 HTTP TCP 110 POP3 TCP 113 ident TCP 119 NNTP UDP/TCP 123 NTP UDP/TCP 137-139 netbios (SMB) TCP 443 HTTPS