Using Networks
Download
Report
Transcript Using Networks
Using Networks
Assignment Issues
• find syntax
• Permissions
• HW4 3c /proc vs /tmp vs /var
Network Utilities
• ifconfig – shows active network
configuration
– eth0 is usually primary interface
– lo0 is loopback
• ssh – Secure SHell, allows access to
servers
• ping – is a server alive?
• traceroute – how do I get there?
Network Utilities
• ftp – File Transfer Protocol, transfer files
– Password is passed in plain text (meaning
anybody can read it)
– sftp is a passable replacement
• wget – command line web browser (sort
of)
Regular Expression for IP
• Question 3 says to search for IP
addresses in /etc
• A regexp of:
– [0-255].[0-255].[0-255].[0-255] will not work!
– One that does:
"(([0-9]|[1-9][0-9]|1[09]{2}|2[0-4][0-9]|25[05])\.){3}"
Network Configuration
More utilities
• arp – Address Resolution Protocol
• ifconfig (again)
– ifconfig down/up
• route – shows routing information
– netstat –r is equivalent
Genmask/Netmask
• Used to get the network and computer from an IP
address
– Network:
• 10.11.12.13 + 255.255.255.0 == 10.11.12.0
– Computer:
• 10.11.12.13 + 0.0.0.255 == 0.0.0.13
Initialization/Booting
Boot Process
• From http://www.ibm.com/developerworks/library/llinuxboot/index.html
Run Levels
• /etc/inittab tells Linux how/what to start
# Default runlevel. The runlevels used by RHS are:
#
0 - halt (Do NOT set initdefault to this)
#
1 - Single user mode
#
2 - Multiuser, without NFS (The same as 3, if
you do not have networking)
#
3 - Full multiuser mode
#
4 - unused
#
5 - X11
#
6 - reboot (Do NOT set initdefault to this)
#
id:3:initdefault:
rc.sysinit
• /etc/rc.d/rc.sysinit – just a script
– 985 lines on Red Hat 5
/etc/rc.d/rc
• Does the work of the run level
• Be sure to read the man page on runlevel (hint! hint!)
– man 8 runlevel
Services/Daemons
• Depend on run level from inittab
– /etc/rc#.d – SysV
– /etc/rc.d/rc#.d – Linux (/etc/rc#.d are sym links)
/etc/rc.d/rc#.d
• Runlevel directories
• Tell what to start or stop on this level
• S = start
• K = kill
• Linux – S/K go from low to high
• SysV (Commerical Unix)
– S goes from low to high
– K goes from high to low