In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "what are the Linux network configuration methods". In the daily operation, I believe many people have doubts about the Linux network configuration methods. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "what are the Linux network configuration methods?" Next, please follow the editor to study!
The first method:
(1) Log in as root, and run the setup command to enter text mode setuputiliy to configure the network. Here, you can set ip, subnet mask, default gateway and dns.
(2) at this time, the configuration of the Nic does not take effect, and the operation we have just done will not take effect until we run the / etc/rc.d/init.d/networkrestart command.
The second method:
(1) ifconfig eth0 x.x.x.x sets the network card
(2) ifconfig eth0 networkx.x.x.x sets the subnet mask
Use the default for broadcast addresses and dns.
This configuration of the network will take effect immediately, but temporarily
The third method:
(1) modify the attributes in the / etc/sysconfig/network-scripts/ifcfg-eth0 file, including ip, subnet mask, broadcast address, and default gateway.
(2) at this time, the configuration of the network card does not take effect, and the configuration we have just made will not take effect until we run the / etc/rc.d/init.d/networkrestart command. This method is the lowest modification method.
RPM package management
A packaging and installation tool for Internet downloads that includes, in some Linux distributions, files with .RPM extensions. RPM is the abbreviation of red hat packagemanager (red hat package Management tool). Although the file format name is marked with the logo of red hat, its original design concept is open, and it is now used in distributions of OpenLinux, SuSE and Turbo Liunx. It can be regarded as a recognized industry standard.
Rpm-qa: query all installed rpm packages
Rpm-qa | more
Rpm-qa | grep x
Rpm-Q package name: query whether the package is installed
Rpm-qi package name: query package information
Rpm-ql package name: query files in the package
Full path name of rpm-qf file: query the software package to which the file belongs
Rpm-qf / etc/password
Rpm-qp package file name: query package information introduction to this package
Rpm-qp jdk-1_5_0-liunx-i586.rpm
Install the rpm package:
Rpm-I RPM package full path name: install to the current system i=install
Rpm-ivh RPM package full path name: the installation package has a message to the current system
I=install v=verbose h=hash
Uninstall the rpm package:
Rmp-e RPM package name
If other packages depend on the package you uninstalled, an error message will be generated when you uninstall it. If you let RPM ignore this error and continue to uninstall (this is not a good idea, because programs that depend on the package may not run). Use the-- nodeps command line option.
Upgrade the RPM package:
Rpm-U RPM package full path name
Samba
Over the years, windows and liunx operating systems have their own user base and market. However, in general companies or schools, there may be both windows and liunx hosts. Windows hosts can use "network neighbors" to access shared resources, and NFS can also enable liunx hosts to access resources. SAMBA service software can realize resource sharing between windows and linux.
The SMB communication protocol adopts the SAMBA S structure, so the SAMBA software can be divided into two parts: the client and the server. By executing the SAMBA client program, the linux host can use the resources shared by the Windows host on the network; while when the SAMBA server is installed on the linux host, the windows host can access the resources shared by the SAMBA server.
Let's take a look at the installation of the samba server, where it is prone to error. I will emphasize in particular:
1. Check whether samba is installed
Rpm-qa | grep samba
2 、 mount / mnt/cdrom
Cd / mnt/cdrom finds the files needed by both the samba client and the server
Rpm-ivhsamba-common-2.2.7a-7.9.0.i386.rpm
Rpm-ivhsamba-2.2.71-7.9.0.i386.rpm server software
Rpm-ivhsamba-client-2.2.71-7.9.0.i386.rpm client software
Cd ~
Umonut / mnt/cdrom
3. Set the samba password file
/ / first create an ordinary user huangjinjin in linux
/ / add all users in / etc/passwd to smbpasswd
View mksmbpasswd.sh file path
You will see / usr/bin/mksmbpasswd.sh in rpm-ql samba
Cd / usr/bin/
Cat / etc/passwd | mksmbpasswd.sh > / etc/samba/smbpasswd
/ / set the samba password of the user huangjinjin
Smbpasswd huangjinjin
4. Start the samba service
Service smb start start
Service smb stop stop
Service smb restart restart
Description of LINUX directory structure:
The entry to the / Liunx file system, which is also the directory at the highest level
The commands required by the / bin base system are located in this directory and are also required by the smallest system, such as ls, cp, mkdir, and so on. The function is similar to / usr/bin, and the files in this directory are executable commands that can be used by ordinary users. The most basic command needed as a basic system is put here.
The kernel of / boot Liunx and the files needed to boot the system program, such as vmlinuzinitrd.img, are located in this directory. In general, the GRUB or LILO system boot manager is also located in this directory.
/ dev device file storage directory, such as sound card, disk, etc.
The location of the / etc system configuration file, and the configuration files for some servers are also in this directory. Such as user account and password profile.
/ home ordinary user home directory default storage directory
The directory where / lib library files are stored
/ sbin is mostly related to system management directory storage, is the super rights user root executable command storage place, ordinary users do not have the authority to execute commands under this directory, this directory and / usr/sbin, / usr/X11R6/sbin or / usr/local/sbin directory is similar; we just remember that all directory sbin contains root permissions can only be executed.
/ tmp temporary file directory, sometimes when the user runs the program, temporary files will be generated. / tmp is used to store temporary files. The / var/tmp directory is similar in function to this directory.
At this point, the study of "what are the methods of Linux network configuration" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.