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 Basic usage of Promise: 1. Crea...
Hello everyone, I am Tony, a teacher who only tal...
This article mainly explains tables, which are no...
background: There is a flask project that provide...
Preface I believe that everyone has had a simple ...
1. Composite primary key The so-called composite ...
When using Navicat to connect to a remote Linux M...
Fast-Linux project address: https://gitee.com/uit...
What is the role of http in node The responsibili...
background Speaking of MySQL deadlock, I have wri...
1. Solution to the problem that the page is blank...
exhibit design Password strength analysis The pas...
Preview versions of Safari (Technology Preview 10...
This article mainly describes how to implement fo...
1. To optimize the query, try to avoid full table...