小编Air*_*ett的帖子

使用 iptables 在 VLAN 之间转发流量

我们的网络上有以下 4 个 VLAN,通过 DHCP 连接到 Ubuntu Linux 机器。这个 Linux 也应该充当 L3 路由器。

VLAN 10  on interface eth1.10  with subnet 10.10.10.0/24
VLAN 20  on interface eth1.20  with subnet 10.10.20.0/24
VLAN 50  on interface eth1.50  with subnet 10.10.50.0/24
VLAN 100 on interface eth1.100 with subnet 10.10.100.0/24
Run Code Online (Sandbox Code Playgroud)

这里是/etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 192.168.10.169
        netmask 255.255.255.0
        gateway 192.168.10.1

auto eth1
iface eth1 inet static
        address 10.10.0.1
        network 10.10.0.0
        netmask 255.255.255.0
        broadcast 10.10.0.255 …
Run Code Online (Sandbox Code Playgroud)

networking linux routing iptables vlan

5
推荐指数
1
解决办法
3万
查看次数

标签 统计

iptables ×1

linux ×1

networking ×1

routing ×1

vlan ×1