"Linux" Classic Linux system engineer face Test (reprint)

Source: Internet
Author: User
Tags ftp client ftp protocol

1. How to forward the local 80 port request to 8080 port, the current host IP is 192.168.16.1, where the local NIC eth0:
For:


# iptables -t nat -A PREROUTING -d 192.168.16.1 -p tcp --dport 80 -j DNAT --to 192.168.16.1:8080

Or


# iptables -t nat -A PREROUTING -i eth0 -d 192.168.16.1 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080

2. What is NAT and what are the differences between Dnat and Snat, and what are the application examples?

Snat,dnat,masquerade are all Nat.
Masquerade is a special case of Snat.

Snat is when the packet is sent out from the network card, the source address part of the packet is replaced with the specified IP, so that the receiver thinks the source of the packet is the host of the IP that is replaced.

Masquerade is to replace the source IP with the IP on the NIC that sends the data, so for those situations where the IP is not fixed, such as Dial-up networking or assigning IP through DHCP, the masquerade is used.

DNAT, that is, when the packet is sent out from the network card, modify the destination IP in the packet, as if you want to access a, but because the gateway did DNAT, all the packets that access a to the destination IP is all modified to B, then, you actually access B

Because the route is selected according to the destination address, the Dnat is carried out on the prerouting chain, and Snat is carried out at the time the data packets is sent out, and therefore on the postrouting chain.

3. What is the difference between packet filtering firewall and proxy application firewall, can you list several corresponding products?


4.iptables whether the time period to control user behavior, such as please write specific steps.

5. Say the several Linux/unix distributions you know.

Redhat, CentOS, Fedora, SuSE, Slackware, Gentoo, Debian, Ubuntu, FreeBSD, Solaris, SCO, AIX, HP ...

6. List Linux common packaging tools and write the corresponding decompression parameters (at least three kinds)

7. Schedule the server to restart 8 o'clock every Sunday.

8. List the software as a complete messaging system, at least two classes.

9, when the user entered a Web site in the browser, say that the computer to DNS interpretation through those processes? Note: Native DNS is not cached yet.

For:
A. User input URL to browser;
B. The browser sends out the DNS request information;
C. The computer first query the local host file, to see if there is a direct return to the results, does not exist, continue to the next step;
D. The computer queries the legitimate DNS server for IP results in the order of local DNS;
E. Legitimate DNS returns DNS results to local DNS, local DNS, and caches this result until the TTL expires before querying this result again;
F. Return IP results to the browser;
G. The browser obtains the page according to the IP information;

10, we all know that DNS uses both the TCP protocol and the UDP protocol, when the TCP protocol is used? When do I use the UDP protocol? Why are you designing this?

Answer: This question needs to understand the thing to compare more, divide a few aspects
A, from packet size: The maximum packet length for UDP is 65,507 bytes, the packet length is more than 512 bytes when responding to DNS queries, and as long as the first 512 bytes are returned, then the name interpreter usually uses TCP from the original request.
B, from the protocol itself: most of the cases using the UDP protocol, we all know that the UDP protocol is an unreliable protocol, DNS is not like other Internet applications using UDP (such as: TFTP,BOOTP and SNMP, etc.), mostly concentrated in the LAN, DNS queries and responses need to go through the WAN, packet loss and the uncertainty of round-trip time is larger on the WAN than on the LAN, which requires the DNS client to need a good retransmission and timeout algorithm, when using TCP.

11, a EXT3 file partition, when using the Touch test.file command to create a new file times wrong, the error message is the prompt disk is full, but the use of df-h command to view the disk size, only used, 60% of the disk space, why this situation, say your reason.

A: Two cases, one is the disk quota problem, the other is the EXT3 file system design is not suitable for many small files and large files of a file format, a lot of small files, easy to cause the inode exhausted.

12, we all know that the FTP protocol has two modes of operation, say their approximate work flow?

FTP Two modes of operation: Active mode (active FTP) and passive mode (Passive FTP)
In active mode, the FTP client randomly opens a port N greater than 1024 to initiate a connection to port 21st of the server, then opens the N+1 port for monitoring and issues the Port n+1 command to the server.
After the server receives the command, it uses its local FTP data port (typically 20) to connect to the client-specified port n+1 for data transfer.

In passive mode, the FTP client randomly opens a port n greater than 1024 to initiate a connection to port 21st on the server, and N+1 port is turned on. Then send the PASV command to the server, notifying the server that it is in passive mode. After the server receives the command, it will open a port greater than 1024 to listen, and then use the Port P command to notify the client, its own data port is p. After the client receives the command, it connects to the server's port p via port n+1 and then transmits data between the two ports.

In general, the active mode of FTP refers to the server actively connect to the client's data port, passive mode of FTP refers to the server passively waiting for the client to connect their own data port.
Passive mode FTP is typically used for FTP clients that are behind a firewall to access an external FTP server, because in this case, the firewall is typically configured not to allow outside access to the host after the firewall, and only allow connection requests initiated by hosts behind the firewall.
Therefore, in this case it is not possible to use Active mode FTP transmission, while the passive mode of FTP can work well.

13. Write a shell script to transfer files larger than 10K in the current directory to the/tmp directory
Q: The main focus is to examine the use of awk

#/bin/sh
#Programm:
# Using for move currently directory To/tmp
For FileName in ' ls-l |awk ' $5>10240 {print $9} '
Do
MV $FileName/tmp
Done
Ls-la/tmp
echo "done!"

14.apache There are several modes of operation, respectively, the characteristics of the following, and explain under what circumstances to adopt different working mode?

Apache has two main modes of operation: prefork (default installation mode for Apache) and worker (can add parameter –with-mpm-worker to select working mode at compile time)
Prefork is characterized by: (Pre-derivation)
1. This mode reduces system overhead by eliminating the need to generate new processes when requests arrive
2. Can prevent accidental memory leaks
3. The number of child processes is automatically reduced when the server load drops
Worker features: Multi-Threading multi-process module supporting mixed multithreading
If the worker mpm is a good choice for a high-traffic HTTP server, the worker mpm consumes less memory than prefork.

15. Noun explanation hdlc,vtp,ospf,rip,ddos,system v,gnu,netscreen,ssh,smartd,apache,wait_time and so on.

16. Write the shell script to get the network address of this machine. For example: The IP address of this machine is: 192.168.100.2/255.255.255.0, then its network address is

192.168.100.1/255.255.255.0

Method One:

#!/bin/bash
#This script print IP and network
File= "/etc/sysconfig/network-scripts/ifcfg-eth0″
If [-f $file]; then
ip= ' grep ' ipaddr "$file |awk-f" = "' {print $} '
mask= ' grep ' NETMASK "$file |awk-f" = "' {print $} '
echo "$IP/$MASK"
Exit 1
Fi

Method Two:

#!/bin/bash
#This Programm'll printf Ip/network
#
ip= ' ifconfig eth0 |grep ' inet ' |sed ' s/^.*addr://g ' |sed ' s/bcast.*$//g '
netmask= ' ifconfig eth0 |grep ' inet ' |sed ' s/^.*mask://g '
echo "$IP/$NETMASK"
Exit

17. Send an email to the command line, sender:[email protected], recipient:[email protected]

Second, a brief question:

1.linux How to change the IP, hostname, DNS
How to add a route under 2.linux
3. Describe the meaning and steps of Linux kernel compilation
4. Brief introduction of Linux boot process
5. Briefly describe the principles of DDoS attacks
6. Brief description of the TCP three-time handshake process
7. What are the common types of VPNs?

Third, design questions:

1. System Design
Please consider the following system design. You can browse through the information and inquire about any information, guidelines, etc. that you have helped.
Your resources:
8 Dual-NIC PC servers with Linux (2.6 cores) and related open source software, switches
Apache 2.2.x
Tomcat 5.5.X
Database system
Up to 8 Internet IP addresses, please design a system:

1, the use of dual Apache web server front-end;
2, the use of the AJP connected to the 3 Tomcat application server, these tomcat is configured to cluster, it is necessary to consider the Apache to the back end of the allocation, the allocation of a fully balanced approach, configure the use of cookies to achieve session stickness;
3.1 database servers only Tomcat needs to be connected and does not need to provide services to the Internet.
4. Consider the safety and maintenance convenience of the system;
5, through the rewrite rule configuration to rewrite subordinate URL rules into a friendly URL
Http://server/webapp/getinfo?id=xxxx&name=yyyy–> Http://server/getinfo/YYYY/XXXX

You need to submit

1, server planning, including:
* Network structure diagram
* IP address assignment for each machine
* Key software running on each machine
* Your safety and maintenance considerations
2, Apache the following configuration file to us:
* extra/http-proxy-ajp.conf
* extra/http-rewrite.conf

2. You can take any device and different operating system server design to the two WWW server and two FTP server load balancing, with network topology diagram to express and explain! (The more methods, the better)

The first method: DNS round-Patrol

WWW1 in A 192.168.1.1
WWW2 in A 192.168.1.2
WWW3 in A 192.168.1.3
FTP1 in A 192.1.1.4
FTP2 in A 192.1.1.5
FTP3 in A 192.1.1.6
www in CNAME www1
www in CNAME www2
www in CNAME www3
FTP in CNAME FTP1
FTP in CNAME FTP2
FTP in CNAME FTP3

"Linux" Classic Linux system engineer face Test (reprint)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.