Linux and Windows also have the IP configuration function. you can use DHCP to automatically obtain or manually specify an IP address. In Linux, how does one modify the nic ip address? 1. the configuration file path cd/etc/sysconfig/network-scripts Nic file is generally & ldquo; ifcfg-eth0 & rdquo; the name of the configuration file, the more NICs, accumulate from 0, 1, 2 & hellip.
Linux and Windows also have the IP configuration function. you can use DHCP to automatically obtain or manually specify an IP address. In Linux, how does one modify the nic ip address?
1. configuration file path
cd /etc/sysconfig/network-scripts
Nic file is generally the name of the "ifcfg-eth0" configuration file, the more the NIC, from 0, 1, 2... Accumulate.
To bind one Nic to multiple addresses, such as the Nic configuration file name is ifcfg-eth0, create a second IP configuration file named ifcfg-eth0: 0, with the naming format of multiple child IP addresses: "ifcfg-eth0: 0", "ifcfg-eth0: 1" and so on, the maximum cannot exceed 255.
II. DHCP automatically obtains IP addresses
# Realtek semiconduco ., ltd. RTL-8139/8139C/8139C + # Nic brand (can be deleted) DEVICE = eth0 # Nic address code BOOTPROTO = dhcp # DHCP automatically get HWADDR = 00: 16: 3E: BC: 82: 0F # Nic MAC address ONBOOT = yes # automatic start upon startup
Refer to the above case, DHCP is used to automatically obtain network information from the route and automatically start the route when it is started.
3. Static IP settings
TYPE = Ethernet # network type device = eth0: 0 # Nic address code/sub-code ONBOOT = yes # boot and run BOOTPROTO = static # Use Protocol (static) IPADDR = 216.18.194.3 # IP address NETMASK = 255.255.255.255.mask # subnet mask GATEWAY = 216.18.194.1 # gateway hwaddr = 00: 16: 3E: 89: 85: 38 # MAC address BROADCAST = 216.18.194.199 # BROADCAST address DNS1 = 8.8.8.8 # domain name resolution server 1DNS2 = 8.8.4.4 # domain name resolution server 2
Refer to the above content to manually set the IP address (generally used for networks without DHCP ).
4. restart the network service to make it take effect
Service network restartifconfig # view the current IP configuration