Debian 10 配置网卡,DNS,IP地址 |
您所在的位置:网站首页 › debian编辑文件 › Debian 10 配置网卡,DNS,IP地址 |
1.查看网卡名。 root@debian:~# ip addr可以看出只有一块网卡,名为ens33。 root@debian:~# ip addr 1: lo: 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: 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 forever2.修改网卡配置文件。 root@debian:~# vi /etc/network/interfaces3.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.conf7.重启Debian刷新网卡。 root@debian:~# reboot8.验证 root@debian:~# ip addr |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |