相关疑难解决方法(0)

数据包不通过 linux 以太网桥

我正在尝试设置一个 eth0 和 eth1 桥接的 debian 8.3 机器,但我无法让数据包通过桥接。目前,eth0 与许多其他主机(包括 DHCP 服务器)连接到 LAN。Eth1 连接到一个普通交换机,并连接了一台机器。

这是我的 /etc/network/interfaces:

iface eth0 inet manual
iface eth1 inet manual

allow-hotplug br0
auto br0
iface br0 inet static
        bridge_ports eth0 eth1
        address 172.16.1.111
        netmask 255.255.0.0
        broadcast 172.16.255.255
        gateway 172.16.1.254
        dns-servers 172.16.1.1
Run Code Online (Sandbox Code Playgroud)

/proc/sys/net/ipv4/ip_forward 设置为 1。

根据连接到eth1网络的测试机上运行的tcpdump,测试机正在发送DHCP请求,但根据桥接主机上运行的tcpdump,它没有收到此类请求。

另一台主机插入连接到 eth1 的交换机也可以看到测试机器确实在发送 DHCP 请求,但同样,在桥接主机上运行 tcpdump 显示没有传入的 DHCP 请求。

当我在网桥主机上的 eth1 上运行 tcpdump 时,我确实看到数据包从网络的 eth0 端传出 eth1,但即使 tcpdump 声称这些数据包正在退出 eth1,eth1 网络上的主机也无法看到任何他们。

如果我给连接到 eth1 的测试机器一个静态 ip 172.16.1.112,它不会从网桥主机(172.16.1.111)得到 ping 响应。插入交换机的另一台主机可以看到测试主机发出 arp who-has 172.16.1.111 请求,但是在桥接主机上的 …

linux networking debian ethernet bridge

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

从现有 WiFi 到以太网的透明桥?

我见过很多将桥接机变成另一个具有自己的 DHCP 服务器的路由器的示例,等等。但我想使用有线设备,就好像它直接连接到原始路由器一样。桥接机自行连接 WiFi 时没有任何问题。

这个答案似乎很接近我想要的,但它也说,The wlan0 interface also has to be condigured to connect to your remote AP so this configuration is not be used verbatim.

正如警告所述,它本身无法工作 - 找不到 WiFi 适配器,因此无法连接 - 但它没有说明如何重新建立原始的工作连接。我怎么做?


/etc/wpa_supplicant/wpa_supplicant.conf是:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US

network={
    ssid="MyNetwork"
    psk="MyPassword"
    key_mgmt=WPA-PSK
}
Run Code Online (Sandbox Code Playgroud)

当 WiFi 工作时,/etc/network/interfaces默认为:

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and …
Run Code Online (Sandbox Code Playgroud)

networking wifi ethernet bridge

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

标签 统计

bridge ×2

ethernet ×2

networking ×2

debian ×1

linux ×1

wifi ×1