Linux双网卡静态路由配置

2023-07-07
1分钟阅读时长

ubuntu

netplan 配置

network:
  ethernets:
    ens18:
      addresses:
        - 10.249.7.209/24
      routes:
          - to: 0.0.0.0/0
            via: 10.249.7.254
            metric: 100
      nameservers:
        addresses:
        - 223.5.5.5
    ens19:
      addresses:
      - 10.249.2.57/24
      routes:
          - to: 10.0.0.0/8
            via: 10.249.2.254
          - to: 10.249.2.0/24
            metric: 150
  version: 2