Linux modifies IP address and shuts down firewall settings

Source: Internet
Author: User

Modify the IP address and turn off boot Firewall 1, ifconfig view ip2, if there is no network card to see if Ifcfg-eth0 file exists cd/etc/sysconfig/network-scripts/ls-s view if there is View Device=eth0     HWADDR=00:0C:29:0f:b8:70    These two options with    vi/etc/udev/rules.d/70- persistent-net.rules    is the same as eth0     if not, use the eth1 NIC    vi/etc/udev/rules.d/70- Persistent-net.rules   View MAC addresses in eth0   and eth1    eth1 Nic's MAC address 00:0c:29:50:bd:17    then modify    vi/etc/sysconfig/network-scripts/ifcfg-eth0  Modify   device=eth1   hwaddr=00:0c:29:0f :b8:70  Restart the NIC    service  network RESTART3 If the network card already exists       1 temporary modification            ifconfig  eth0 172.16.10.82     2 Perpetual modification       Example: fixed IP by the original DHCP
device=eth0hwaddr=00:0c:29:f7:ef:bfonboot=yestype=ethernetnetmask=255.255.255.0ipaddr=192.168.0.68gateway= 192.168.0.1 Restart/etc/init.d/network Restart ####################### #防火墙设置

1. Permanent effect after reboot

Open: Chkconfig iptables on

OFF: Chkconfig iptables off

2, immediate effect, after restart failure:

Open: Service iptables start

Close: Service iptables stop

/etc/init.d/iptables status will get a series of messages stating that the firewall is open.

/etc/rc.d/init.d/iptables Stop shutting down the firewall

/etc/init.d/iptables stop

Linux modifies IP address and shuts down firewall settings

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.