The /etc/network/interfaces file in Linux is used to configure network interfaces. Initialize Ethernet Interface Most network interface configurations can be done in /etc/network/interfaces. For example, configure a static IP (DHCP) for the network card, set routing information, configure the IP mask, set the default route, etc. PS: If you want to automatically start the network port when the system starts, you need to add a line of auto, as shown in the example below. 1. Use a dynamic IP address auto eth0 iface eth0 inet dhcp 2. Use a static IP address auto eth0 iface eth0 inet static address 192.168.1.100 netmask 255.255.255.0 gateway 192.168.1.1 # network 192.168.1.0 # broadcast 192.168.1.255 The default values for network and broadcast are usually sufficient. 3. Check the routing table # route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0 192.168.1.0 * 255.255.255.0 U 0 0 0 eth0 # route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 route -n does not resolve names. The above is the relevant content compiled by the editor of 123WORDPRESS.COM. Thank you for your learning and support. You may also be interested in:
|
<<: SQL serial number acquisition code example
>>: Native js to achieve puzzle effect
Table of contents Preface 1. Object.freeze() 2. O...
Introduce two methods to view MySQL user permissi...
Table of contents Preface Relationships between v...
1. Add fields: alter table table name ADD field n...
There are two types of Linux system time. (1) Cal...
In an unordered list ul>li, the symbol of an u...
I would like to quote an article by Zhang Xinxu a...
Table of contents 1. Problem Description 2. Probl...
The MERGE storage engine treats a group of MyISAM...
Assume there is such an initial code: <!DOCTYP...
Copy code The code is as follows: <!--[if !IE]...
Table of contents 1. Get the first link first 2. ...
Table of contents 1 Introduction to user variable...
MySQL 5.7.18 free installation version installati...
Table of contents Problem description: Installati...