Linux network configuration + firewall + YUM

Target
1. Network configuration
2. Firewall settings
3. The CD is automatically mounted
4. Configuration of local YUM source


1. Network configuration
1. Add temporary IP
ifconfig eth0 The first IP address netmask subnet mask up
ifconfig eth0:0 The second IP address netmask subnet mask up

2. Check whether the networkmanager service is started
[root@localhost ~]# systemctl status NetworkManager
uses graphical settings
[root@localhost ~]# nmtui


add modification delete save exit
[root@xuegod61 ~]# systemctl restart network restart service

3. Use command to modify IP
[root@xuegod61 ~]# vi / etc/sysconfig/network-scripts/ifcfg-eno16777736 //Network card configuration file

TYPE="Ethernet" BOOTPROTO
="static"
DEFROUTE="yes"
PEERDNS="yes"
PEERROUTES="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes "
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_FAILURE_FATAL="no"
NAME="eno16777736"
UUID="c9b5904f-b5c2-492d-a23b-1611742ba8c9"
DEVICE="eno16777736"
ONBOOT="yes" DNS
IPADDR=192.168.145.137
GATEWA.2Y =19 PREFIX=24 Press esc --> Enter: wq Enter to save and exit 2. Firewall settings [root@xuegod60 ~]# systemctl status firewalld. service # View status [root@xuegod60 ~]# systemctl stop firewalld #Temporary shutdown [root@xuegod60 ~]# systemctl disable firewalld #Automatic shutdown at startup Turn off selinux and set up automatic shutdown at startup //Temporary shutdown [root@xuegod60 ~]# setenforce 0  //Permanently close [root@xuegod60 ~]# vim /etc/sysconfig/selinux 3. The CD is automatically mounted



















[root@xuegod60 ~]# echo "/dev/cdrom /mnt iso9660 defaults 0 0 " >> /etc/fstab //similar to vim /etc/fstab and then add
[root@xuegod60 ~]# mount -a / at the end of the file /View the mount
[root@xuegod60 ~]# df -Th //View the mount point

4. The configuration of the local YUM source
must first mount the local CD file (step 3, the mount point here is /mnt)
//View Configured yum source
[root@localhost ~]# ll /etc/yum.repos.d/

[root@localhost ~]# vim /etc/yum.repos.d/rhel.repo
[rhel7-server]
name= rhel7-server
baseurl=file:///mnt
enabled=1
gpgcheck=0

[root@localhost ~]# yum clean all #Empty yum cache
[root@localhost ~]# yum list #Generate cache list
//Ok

yum for software Common commands for package operations:

1. Use YUM to find software packages
Command : yum search
2. List all installable software packages
Command: yum list
3. List all updateable packages
Command : yum list updates
4. List all installed packages
Command : yum list installed
5. List all installed packages but not in Yum Repository
Command : yum list extras
6. List the specified packages
Command : yum list
7. Use YUM to get package information
Command : yum info
8. List all package information
Command : yum info
9. List all updateable packages Package information
Command : yum info updates
10. List all installed package information
Command : yum info installed
11. List all installed package information but not in Yum Repository
Command : yum info extras
12. List software What files are provided by the package
Command : yum provides













Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326335033&siteId=291194637