我想在一个小型linux设备上与一个特殊的IP地址通信,该设备有两个以太网接口,在桥上使用。
这座桥是这样架设的:
# Delete bridge if it exists
ip link delete $BRIDGE_IF type bridge
# Prepare device-facing interface
ip link set dev $DEVICE_IF down
ip address flush dev $DEVICE_IF
ip address add 0.0.0.0 dev $DEVICE_IF
ip link set dev $DEVICE_IF up
# Prepa
我目前有一个linux系统,只有一个物理以太网端口。这个物理端口有eth0网络接口。我想要创建另一个以太网接口,它也使用这个单一的物理端口。如何使用/etc/network/interfaces文件实现这一点?
我的最终目标是能够使用一个以太网端口访问两个不同的网络。例如,如果我有以下interfaces文件:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.11
netmask 255.255.255.0
gateway 192