1.查看网卡名。
root@debian:~# ip addr
可以看出只有一块网卡,名为ens33。
root@debian:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000
link/ether 00:0c:29:cd:3f:b8 brd ff:ff:ff:ff:ff:ff
inet 192.168.20.132/24 brd 192.168.20.255 scope global dynamic ens33
valid_lft 1751sec preferred_lft 1751sec
inet6 fe80::20c:29ff:fecd:3fb8/64 scope link
valid_lft forever preferred_lft forever
2.修改网卡配置文件。
root@debian:~# vi /etc/network/interfaces
3.dhcp配置示例
4.静态配置方式。(多块网卡可以写多个)
# This file describes the network interfaces available on your sys
# This file describes the network interfaces available on your sys
tem
# and how to activate them. For more information, see interfaces(5
).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug ens33 #ens33网卡名
iface ens33 inet static #静态地址
address 192.168.20.100/24 #ip地址/掩码
gateway 192.168.20.2 #网关
dns-nameservers 8.8.8.8 #dns
5.保存退出 Esc+:wq
6. 修改DNS配置文件
root@debian:~# vim /etc/resolv.conf
7.重启Debian刷新网卡。
root@debian:~# reboot
8.验证 文章来源:https://www.toymoban.com/news/detail-523176.html
root@debian:~# ip addr
文章来源地址https://www.toymoban.com/news/detail-523176.html
到了这里,关于Debian 10 配置网卡,DNS,IP地址的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!