Ubuntu 中 eth1 和 wlan0 之间的连接

Ubuntu 中 eth1 和 wlan0 之间的连接

我有 3 个 NIC,分别是 eth0、eth1 和 wlan0。eth0 通过路由器连接到互联网。DHCP 服务器正在为本地网络的 eth1 和 wlan0 运行。eth1 和 wlan0 上的客户端可以访问互联网。我想要做的是 eth1 和 wlan0 上的客户端在本地网络中相互通信。但是他们没有。这是我的配置。

#loopback
auto lo
iface lo inet loopback

# WAN interface
auto eth0
iface eth0 inet dhcp

# LAN interface
auto eth1
iface eth1 inet static
  address 192.168.100.1
  network 192.168.100.0
  netmask 255.255.255.0

  broadcast 192.168.100.255

# Wireless interface
auto wlan0
iface wlan0 inet static
  address 192.168.200.1
  network 192.168.200.0
  netmask 255.255.255.0
  broadcast 192.168.200.255

请帮助我如何建立 eth1 和 wlan0 之间的连接。

是否配置

eth0      Link encap:Ethernet  HWaddr 02:81:98:36:1f:c1  
          inet addr:192.168.1.35  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::81:98ff:fe36:1fc1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7823 errors:0 dropped:1 overruns:0 frame:0
          TX packets:6358 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2892002 (2.8 MB)  TX bytes:867774 (867.7 KB)
          Interrupt:42 

eth1      Link encap:Ethernet  HWaddr 06:30:20:6d:01:4b  
          inet addr:192.168.100.1  Bcast:192.168.100.255  Mask:255.255.255.0
          inet6 addr: fe80::430:20ff:fe6d:14b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6003 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6040 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:864427 (864.4 KB)  TX bytes:2647145 (2.6 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:763 errors:0 dropped:0 overruns:0 frame:0
          TX packets:763 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:168850 (168.8 KB)  TX bytes:168850 (168.8 KB)

wlan0     Link encap:Ethernet  HWaddr 8c:f7:10:46:db:b4  
          inet addr:192.168.200.1  Bcast:192.168.200.255  Mask:255.255.255.0
          inet6 addr: fe80::8ef7:10ff:fe46:dbb4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:2740 (2.7 KB)

我尝试添加如下规则。

iptables -A FORWARD -i wlan0 -o eth1 -j ACCEPT
iptables -A FORWARD -i eth1 -o wlan0 -j ACCEPT

答案1

原因是Windows客户端的防火墙。我没有想到防火墙竟然连ping都屏蔽了。

相关内容