Configure the static IP address in ubuntu. the path of the static IP address is Java code/etc/network/interfaces. the configuration is as follows: www.2cto. comJava code autoeth0 // use the first network adapter ifaceeth0inetstatic // statically allocate ipaddress172.16.21... configure the static IP address in ubuntu. the path of the static IP address is Java code/etc/network/interfaces: www.2cto.com Java code auto eth0 // use the first network adapter iface eth0 inet static // static allocation IP address 172.16.21.234 // IP address gateway 172.16.21.1 // gateway netmask 255.255.255.255.0 // subnet mask network 172.16.21.0 // What does broadcast 1 mean? 72.16.21.255 // broadcast address, restart the network service Java code/etc/init. d/networking restart, and then connect the intranet machine of the unified network segment. To connect to the Internet, you also need to configure DNS information. You need to configure the DNS server information in Java code www.2cto.com/etc/resolv. conf. The following example deletes the previous configuration in the file, add the following configuration to the Java code nameserver 172.16.24.12 // enter the actual dns ip address and restart the NIC to make the configuration take effect. Java code/etc/init. d/networking restart has a disadvantage,/etc/resolv. when the conf file is restarted, the system will rewrite the file based on the information allocated by DHCP,
The previous content will be overwritten. Therefore, this method is temporary. There are many methods on the Internet to prevent/etc/resolv. conf from being overwritten, such as stopping the network service to automatically start at startup.
In fact, they are all incorrect. The specific method still needs to be searched. Author: lichuanbao
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.