This article mainly discusses how to set up a virtual network system in Linux for class use, and how to simulate Internet teaching through a self-built Intranet system in the classroom. Without going online, the classroom can view the same content as the real website, provide the same operations, have a Homepage space and an e-mail account, and block the teaching of pornographic network pollution, provides a convenient and clean environment for online teaching. The topic discussed is about how to set up practices-hardware conditions, how to set up Linux, set up www Virtual platforms, set up DNS, and how to put data on real websites, and use and maintenance.
1. Preface
Network teaching is an indispensable part of information education. However, the lack of network equipment and bandwidth in schools, coupled with the simultaneous launch of the entire classroom, results in slow network speeds, the proliferation of pornographic websites, and the difficulty in obtaining e-mail accounts and Homepage space, in this way, many schools still have many troubles in online teaching even if they are online. What's more, some classrooms are still not online. To solve these problems, some publishing companies can set up virtual websites for schools to provide classrooms with network adapters for internal use. A virtual website is a data cut down from a real website in advance, so it is not real-time information, but it can solve most of the problems mentioned above in network teaching. Although this kind of VM provides great convenience for teaching, publishing companies usually require students to buy books as a condition. However, on the topic of purchasing books, it also causes another problem. In view of this, I would like to share with you some experiences in setting up virtual networks in Linux.
Setting up practices
I. hardware status:
First, the computer in the classroom must contain a network card and make relevant settings. Network line whether it is with coaxial cable (RG-58), or with twisted pair wire (RJ-45) connection, do not have to external online, as long as the indoor lan has a pass on the line.
Ii. Related settings when setting up Linux:
Many books have detailed introductions on Linux installation. However, we must pay attention to some network configuration issues.
When you install Network Configuration or execute netconfig to set the Network, you must enter the Hostname and Domain name. Hostname is the host name installed,
Because this VM does not need external connection, you can just name it, but you can also use the name of your school. Take Songshan High School Computer Classroom 2 as an example and name it c2.sssh.tp.edu.tw, the Hostname is c2, and the Domain name is sssh.tp.edu.tw.
On the LoopBack Only issue, select <NO> and fill in the relevant data:
1. Local IP Address: Enter 203.72.64.150 in Songshan high school. This is the Client end.
The DNS address.
2. Gatway Address: 203.72.64.254
3. Netmask: 255.255.255.0
4. Nameserver: Answer YES and set the IP Address of Domain Name Server
IP Address of the VM: 203.72.64.150
In this way, the netconfig settings in the virtual network are completed. Note that if the school is connected to the Internet, you can enter the actual IP Address in the above four steps, but it is best to enter the IP Address of your host in the Domain Name Server. In this case, no matter whether the DNS of the school network management center is on or off, the virtual network system in the classroom will not be affected.
3. Set up a www Virtual Platform
There are many types of WWW Server kits in Linux. I will take Apache as an example. The book also provides a detailed description of its setup method, but after the setup, you must modify some settings to meet our needs.
Find the <Virtual Host> line in httpd. conf, remove the # Starting with <Virtual Host> to </Virtual Host>, and make some modifications. If you want to set up a virtual platform of the Normal University, you must set it:
<Virtual Host www.ntnu.edu.tw>
Server Admin webmaster@www.ntnu.edu.tw
DocumentRoot/var/lib/httpd/htdocs/ntnu
ServerName www.ntnu.edu.tw
</Virtual Host>
It means that there is a virtual website in the Server with the website www.ntnu.edu.tw. The homepage data will be stored in/var/lib/httpd/htdocs/ntnu. So we are about to wait.
Open a directory named ntnu under/var/lib/httpd/htdocs, and then drop the data cut from the real website to/var/lib/httpd/htdocs/ntnu. It doesn't matter how to set the email address of Server Admin. If you want to add other virtual websites, you can continue with the above example.
4. Set up DNS:
DNS is executed by a program named, which is usually installed in/var/sbin/named. There are many files related to DNS setup, which are described as follows:
1./etc/named. boot
This file is read when named is started. In the preceding example, the file content is as follows:
Directory/etc/named. data
Domain sssh.tp.edu.tw
Primary 0.0.127.in-addr. arpa named. local
Primary 64.72.203.in-addr. arpa named. rev
Primary sssh.tp.edu.tw named. hosts
Primary ntnu.edu.tw named. ntnu
Cache. named. cache
Directory is the directory for storing named-related data. You can set it as/etc/named. create a named under/etc. data directory, and then set named. local, named. rev, named. hosts, named. ntnu, named. cache files are stored in/etc/named. under data. The contents of these archives must be generated by the text processing software (Vi or Joe. If the previous <Virtual Host> has joined more Virtual websites, you must go to primary ntnu.edu.tw named. ntnu
Continue to add it later.
2./etc/named. data/named. local
@ In soa c2.sssh.tp.edu.tw. hostmaster.c2.sssh.tp.edu.tw.
(10134 43200 3600 604800 86400)
In ns c2.sssh.tp.edu.tw.
1 in ptr c2.sssh.tp.edu.tw.
For more information about the numbers and the meanings of soa in ns ptr, see "dns howto" on the network. The host name must be set to a correct one, it should be okay to copy. Note that you must add "." (for example, c2.sssh.tp.edu.tw.) to the host name.
3./etc/named. data/named. rev
@ In soa c2.sssh.tp.edu.tw. hostmaster.c2.sssh.tp.edu.tw.
(10134 43200 3600 604800 86400)
In ns c2.sssh.tp.edu.tw.
1 in ptr c2.sssh.tp.edu.tw.
4./etc/named. data/named. hosts
@ In soa c2.sssh.tp.edu.tw. hostmaster.c2.sssh.tp.edu.tw.
(10134 43200 3600 604800 86400)
In ns c2.sssh.tp.edu.tw.
C2.sssh.tp.edu.tw. in a 203.72.64.150
Ftp in cname c2.sssh.tp.edu.tw.
Mail in cname c2.sssh.tp.edu.tw.
Www in cname c2.sssh.tp.edu.tw.
Bbs in cname c2.sssh.tp.edu.tw.
The last four lines of ftp, mail, www, bbs, etc. depend on which servers are set up on the host. For example, if no bbs is set up, this line does not need to be written.
(5)/etc/named. data/named. ntnu
@ In soa www.ntnu.edu.tw. hostmaster.www.ntnu.edu.tw.
(10134 43200 3600 604800 86400)
In ns www.ntnu.edu.tw.
Www.ntnu.edu.tw. in a 203.72.64.150
This file is the ip address corresponding to the web site of the virtual platform. We set it to the ip address of the Linux host. If more virtual websites are added. create some files under the data Directory, such as named. ntu (large), named. tvbs (TVBS )... . The file content is compared with named. ntnu, and then