Linux initialization configuration IP, hostname, firewall

Source: Internet
Author: User


1. Configure IP Address

#vim/etc/sysconfig/network-scripts/ifcfg-eth0


Bootproto=static

Onboot=yes

ipaddr=192.168.1.2

netmask=255.255.255.0

gateway=192.168.1.254


#vim/etc/udev/rules.d/70-persistent-net.rules


2. Configure host Name:

# vim/etc/sysconfig/network

Networking=yes

Hostname=Localhost.localdomain


#vim/etc/hosts

192.168.1.2 hostname


3. Turn off the firewall:

(1) Turn off boot

Open: Chkconfig iptables on

OFF: Chkconfig iptables off


(2) Close the service

Open: Service iptables start

Close: Service iptables stop


This article is from the "Wind Valley" blog, please be sure to keep this source http://chenchunjia.blog.51cto.com/1878790/1949709

Linux initialization configuration IP, hostname, firewall

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.