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
Basic Concepts Current read and snapshot read In ...
Preface If you frequently access many different r...
Insert image tag <IMG> The colorful web page...
MySQL's foreign key constraint is used to est...
Table of contents 1. Basic configuration of Nginx...
question In LINUX, periodic tasks are usually han...
Table of contents Index Model B+Tree Index select...
1. Implementation principle of Nginx load balanci...
1. When the width of the adjacent floating layer o...
MySQL escape Escape means the original semantics ...
1. Varnish Overview 1. Introduction to Varnish Va...
Table of contents 1. Extracting functions 2. Merg...
The first solution is to push the image to a publ...
The automatic scrolling effect of the page can be...
Table of contents 1. Character Function 1. Case c...