前置条件:安装vlan包

    1. # This file describes the network interfaces available on your system
    2. # and how to activate them. For more information, see interfaces(5).
    3. source /etc/network/interfaces.d/*
    4. # The loopback network interface
    5. auto lo
    6. iface lo inet loopback
    7. auto eno1
    8. iface eno1 inet manual
    9. auto eno1.4
    10. iface eno1.4 inet manual
    11. vlan-raw-device eno1
    12. auto eno1.5
    13. iface eno1.5 inet manual
    14. vlan-raw-device eno1
    15. auto eno1.6
    16. iface eno1.6 inet manual
    17. vlan-raw-device eno1
    18. auto eno1.7
    19. iface eno1.7 inet manual
    20. vlan-raw-device eno1
    21. auto eno1.26
    22. iface eno1.26 inet manual
    23. vlan-raw-device eno1
    24. auto br0
    25. iface br0 inet static
    26. address 172.17.240.197
    27. network 172.17.240.0
    28. netmask 255.255.255.0
    29. gateway 172.17.240.254
    30. dns-nameservers 202.96.134.133
    31. dns-nameservers 114.114.114.114
    32. bridge_ports eno1.26
    33. bridge_stp off
    34. bridge_fd 0
    35. bridge_maxwait 0
    36. auto br1
    37. iface br1 inet manual
    38. bridge_ports eno1.4
    39. bridge_stp off
    40. bridge_fd 0
    41. bridge_maxwait 0
    42. auto br2
    43. iface br2 inet manual
    44. bridge_ports eno1.5
    45. bridge_stp off
    46. bridge_fd 0
    47. bridge_maxwait 0
    48. auto br3
    49. iface br3 inet manual
    50. bridge_ports eno1.6
    51. bridge_stp off
    52. bridge_fd 0
    53. bridge_maxwait 0
    54. auto br4
    55. iface br4 inet manual
    56. bridge_ports eno1.7
    57. bridge_stp off
    58. bridge_fd 0
    59. bridge_maxwait 0