1. Configure a static IP address
$sudo vim /etc/network/interfaces
The original content only has the following two lines:
auto lo
iface lo inet loopback
Append the following to the end:
auto eth0
iface eth0 inet static
address 192.168.1.33
gateway 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168..255
Then save and exit;
2. Manually configure dns (this file is a dynamic DNS and will be restored to default after restart)
$sudo vim /etc/resolv.conf
I want to add the following to the end:
nameserver 192.168.1.1
Then save and exit.
3. Restart the network to make the changes take effect
$sudo /etc/init.d/networking restart
There is a problem here. After restarting Ubuntu, I found that I could not access the Internet again. The problem lies in /etc/resolv.conf. After restarting, the DNS configured in this file is automatically changed to the default value. So it is necessary to permanently modify the DNS. The method is as follows:
Method 1: Add dns-nameservers 8.8.8.8 to /etc/network/interfaces
Method 2: /etc/resolvconf/resolv.conf.d/base insert nameserver 8.8.8.8 nameserver 8.8.4.4
Save resolvconf -u View cat /etc/resolv.conf
vim /etc/resolvconf/resolv.conf.d/base
cd /etc/resolvconf/resolv.conf.d/
# cat base
nameserver 192.168.0.1
nameserver 8.8.8.8
nameserver 8.8.4.4
Previous article:JZ2440 Development Notes (5) - Light up the LED by pressing a button
Next article:JZ2440 Development Notes (3) - Configuring TFTP
Recommended ReadingLatest update time:2024-11-16 21:01
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Can the differential pairs be wound with equal lengths like this?
- RTT & Renesas High-Performance CPK-RA6M4 Development Board Review - Light Sensor
- FreeRTOS Expands IoT Security Technologies
- EEWORLD University Hall----Live Replay: ST's IO-Link-based environmental monitoring and predictive maintenance solutions
- Huawei FPGA Design Specifications
- The circuit diagram channel has been upgraded, come and watch~
- Antenna Principle
- How many people take the Chinese New Year holiday according to the statutory holiday!!!
- X-NUCLEO-IKS02A1 Industrial Sensor Evaluation Board Data
- FAQ_About the pulse problem when the output port of BlueNRG-2 remains at a low level in low power mode