标签:
如题:如何给Linux系统设置静态IP地址
# Configuration for eth0 DEVICE=eth0 BOOTPROTO=none # This line ensures that the interface will be brought up during boot. ONBOOT=yes # eth0 - This is the main IP address that will be used for most outbound connections. # The address, netmask, and gateway are all necessary. IPADDR=192.168.100.5 NETMASK=255.255.255.0 GATEWAY=198.168.100.1
File: /etc/sysconfig/network-scripts/ifcfg-eth0:0
# Configuration for eth0:0 DEVICE=eth0:0 BOOTPROTO=none # This line ensures that the interface will be brought up during boot. ONBOOT=yes # eth0:0 IPADDR=192.0.2.6 NETMASK=255.255.255.0
File: /etc/sysconfig/network-scripts/ifcfg-eth0:1
# Configuration for eth0:1 DEVICE=eth0:1 BOOTPROTO=none # This line ensures that the interface will be brought up during boot. ONBOOT=yes # eth0:1 # This is a private IP address. Private IPs do not have a gateway (they are not publicly routable). # All you need to specify is the address and netmask IPADDR=192.168.133.234 NETMASK=255.255.128.0
service network restart
DEVICE="eth0" HWADDR="00:21:70:10:7E:CD" NM_CONTROLLED="no" ONBOOT="yes" BOOTPROTO=static # BOOTPROTO=dhcp IPADDR=192.168.1.106 NETMASK=255.255.255.0 # # the GATEWAY is sometimes in: /etc/sysconfig/network GATEWAY=192.168.1.1
标签:
原文地址:http://www.cnblogs.com/Mrhuangrui/p/4579290.html