You know, you get used to ipconfig in windows, and it is a lot of trouble to view IP addresses in centos;
The information collected today focuses on IP port problems:
- View IP
Ifconfig eth0 → view the IP address, but the output information is more
Ifconfig | grep 'bcast' → the output information should be much clearer.
- Modify IP address and take effect
Edit/etc/sysconfig/network-scripts/ifcfg-eth0 and follow the settings below
Device = eth0
Bootproto = static
Hwaddr =
Onboot = Yes
Type = Ethernet
Ipaddr = <your IP address>
Netmask = 255.255.255.0
The MAC address can be viewed using the ifconfig eth0 command.
After setting, restart the network service:Service Network restart
- After the centos system is installed, only port 22 is enabled by default. to open other ports, open the required ports.
VI/etc/sysconfig/iptables
Then add the JavaCode
-A RH-Firewall-1-INPUT-M state -- state new-m tcp-p tcp -- dport 3001-J accept
-A RH-Firewall-1-INPUT-M state -- state new-m tcp-p tcp -- dport 3001-J accept
Finally, the centos system needs to restart the service Java code.
/Sbin/service iptables restart
/Sbin/service iptables restart
Check whether Java code is enabled on the port
/Sbin/iptables-l-N
This operation is required to connect to the server using the mysql client, open port 3306, and configure nginx. This obstacle is no longer available now. Let's continue ......
You know, you get used to ipconfig in windows, and it is a lot of trouble to view IP addresses in centos;
The information collected today focuses on IP port problems:
- View IP
Ifconfig eth0 → view the IP address, but the output information is more
Ifconfig | grep 'bcast' → the output information should be much clearer.
- Modify IP address and take effect
Edit/etc/sysconfig/network-scripts/ifcfg-eth0 and follow the settings below
Device = eth0
Bootproto = static
Hwaddr =
Onboot = Yes
Type = Ethernet
Ipaddr = <your IP address>
Netmask = 255.255.255.0
The MAC address can be viewed using the ifconfig eth0 command.
After setting, restart the network service:Service Network restart
- After the centos system is installed, only port 22 is enabled by default. to open other ports, open the required ports.
VI/etc/sysconfig/iptables
Then add the Java code to the centos system.
-A RH-Firewall-1-INPUT-M state -- state new-m tcp-p tcp -- dport 3001-J accept
-A RH-Firewall-1-INPUT-M state -- state new-m tcp-p tcp -- dport 3001-J accept
Finally, the centos system needs to restart the service Java code.
/Sbin/service iptables restart
/Sbin/service iptables restart
Check whether Java code is enabled on the port
/Sbin/iptables-l-N
This operation is required to connect to the server using the mysql client, open port 3306, and configure nginx. This obstacle is no longer available now. Let's continue ......