当前位置首页 > Debian知识

Debian-linux网卡配置

阅读次数:196 次  来源:admin  发布时间:

Debian 网卡配置在 /etc/network/interface

#网桥的配置
auto lo
iface lo inet loopback

iface enp5s0f0 inet manual

iface enp5s0f1 inet dhcp

auto vmbr0
iface vmbr0 inet static
        address 10.40.64.142
        netmask 255.255.255.0
        gateway 10.40.64.254
        bridge_ports enp5s0f0
        bridge_stp off
        bridge_fd 0

#单网卡的手动配置
auto eth0 #开机自动启动
iface eth0 inet static #静态IP设置
        address 192.168.0.10 #本机IP
        netmask 255.255.255.0 #子网掩码
        gateway 192.168.0.1 #网关
    
#dhcp方式
iface eth0 inet dhcp

#设置dns
echo "nameserver 114.114.114.114" >> /etc/resolv.conf

#配置好后重启网卡
ifdown eth0 && ifup eth0
或者
service networking restart
                    
上一篇:Linux命令打包解压详解
下一篇:nginx+lua-nginx-module编译