set 'enp60s0f0' (enp60s0f0) as default for IPv4 routing and DNS
时间: 2023-12-24 12:02:25 浏览: 29
To set "enp60s0f0" as the default for IPv4 routing and DNS in Linux, you can follow these steps:
1. Open the network configuration file for editing. The location of the file may vary depending on your Linux distribution, but it is commonly found at "/etc/network/interfaces" or "/etc/sysconfig/network-scripts/ifcfg-enp60s0f0".
For example, you can use the following command to open the file with the nano text editor:
```
sudo nano /etc/network/interfaces
```
2. Within the configuration file, locate the section for "enp60s0f0" or the corresponding network interface. It may look similar to this:
```
auto enp60s0f0
iface enp60s0f0 inet dhcp
```
3. Modify the configuration to set a static IP address and DNS server. Replace "dhcp" with "static", and add the desired IP address, netmask, gateway, and DNS server(s). For example:
```
auto enp60s0f0
iface enp60s0f0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 8.8.4.4
```
Make sure to adjust the IP address, netmask, gateway, and DNS server(s) according to your network configuration.
4. Save the changes and exit the text editor.
5. Restart the networking service to apply the changes:
- For Ubuntu / Debian:
```
sudo systemctl restart networking
```
- For CentOS / Red Hat:
```
sudo systemctl restart network
```
Now, "enp60s0f0" should be set as the default interface for IPv4 routing and DNS. You can verify this by checking the output of the `ip route` command or by testing network connectivity.