Linux网络设置

更新于 2024-08-05

debian/alpine

#/etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
      address 172.25.153.8
      netmask 255.255.240.0
      gateway 172.25.144.1
      dns-nameservers 223.5.5.5 8.8.8.8
      metric 100 #多网卡调整metric,或者内网网卡不配置网关
service networking restart