Teach you how to complete Linux network address configuration

  
                  

If you want to learn about Linux, learn some 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. Shut down and open the network port:

Open 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. Shut down and open the physical port

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. Configuration of network address

a.ifconfig eth0 xxxx netmask xxxx broadcast xxx

b. Configure the ifcfg-xx file

by configuration file

/etc/sysconfig/network-scripts/For example: ifcfg-eth0

If you want Configure multiple addresses on a NIC, the configuration file is ifcfg-eth0:1, ifcf G-eth0:2, etc.

c. Restart the network service, /etc/init.d/network restart or service network restart

This makes it easy to configure the Linux network address.

Copyright © Windows knowledge All Rights Reserved