Article title: describes how to configure Linux network addresses. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
If you want to know about Linux, learn about Linux. This article explains the Linux network address configuration for you. I hope you can understand the Linux network address configuration. let's talk about this in detail.
1. disable and enable the network Port:
Enable port 81:
Iptables-I input-I eth0-p tcp -- dport 81-j ACCEPT
Iptables-I OUTPUT-o eth0-p tcp -- sport 81-j ACCEPT
Close Port 81:
Iptables-I input-I eth0-p tcp -- dport 81-j DROP
Iptables-I OUTPUT-o eth0-p tcp -- sport 81-j DROP
2. disable and enable physical ports
UP: ifconfig eth0 up
DOWN: ifconfig eth0 down
Or
/Sbin/ifup eth0
/Sbin/ifdown eth0
/Sbin/ifup ifdown is a symbolic link to/etc/sysconfig/network-scripts/ifup down
3. configure the network address
A. ifconfig eth0 x. x netmask x. x broadcast x.
B. configure through the configuration file
/Etc/sysconfig/network-scripts/file for configuring ifcfg-xx
Such as: ifcfg-eth0
If you want to configure multiple addresses on a network card, the configuration file is ifcfg-eth0: 1, ifcfg-eth0: 2, etc.
C. restart the network service,/etc/init. d/network restart or service network restart
In this way, you can easily complete the Linux network address configuration.