雙網卡(wlan0 ,eth0)同時sock收資料 - Linux

By Harry
at 2015-09-24T23:44
at 2015-09-24T23:44
Table of Contents
我在A電腦送兩份資料到B電腦
A 一份資料送給 B的eth0網卡那個IP
A 另外一份資料送給 B的wlan0無線網卡的那個IP
但是B 的linux只會接收default gateway那一張網卡資料,不曉得為什麼
Ubuntu 12.04
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0
192.168.1.0 0.0.0.0 255.255.255.0 U 1 0 0 wlan0
140.117.89.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0
是哪邊的要改嗎?
我這樣的rule,socket只會接收default gateway那一張網卡的資料
我開wireshark去看兩支網卡,封包都有進來,
但是socket就只能接收到,default gateway那一張網卡的資料
PS. Ubuntu 12.04 和 Ubuntu 10.04 差別
10.04 default GW rule會是最後一個
我記得routing table排序會跟優先權有關係
Ubuntu 10.04
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0
10.0.3.0 0.0.0.0 255.255.255.0 U 1 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
謝謝
--
Tags:
Linux
All Comments

By Madame
at 2015-09-28T04:57
at 2015-09-28T04:57

By George
at 2015-09-28T22:04
at 2015-09-28T22:04

By Gilbert
at 2015-10-03T10:21
at 2015-10-03T10:21

By Sandy
at 2015-10-04T06:55
at 2015-10-04T06:55

By George
at 2015-10-05T22:50
at 2015-10-05T22:50

By Elvira
at 2015-10-10T15:00
at 2015-10-10T15:00

By Leila
at 2015-10-10T21:21
at 2015-10-10T21:21

By Lauren
at 2015-10-12T11:02
at 2015-10-12T11:02
Related Posts
好用的效能分析工具?

By Doris
at 2015-09-24T17:40
at 2015-09-24T17:40
CentOS 5.8安裝不進USB內

By Ida
at 2015-09-23T19:47
at 2015-09-23T19:47
fedora 22找不到syscall_table 求解

By Dinah
at 2015-09-23T18:18
at 2015-09-23T18:18
有關m3u8的支援度

By Todd Johnson
at 2015-09-23T17:52
at 2015-09-23T17:52
socket setsockopt

By Mary
at 2015-09-23T15:27
at 2015-09-23T15:27