Такая ситуация, есть два сетевых интерфейса (проводной и беспроводной), смотрят в одну и ту же сеть, получают разные ip-адреса от одного и того же dhcp-сервера, но в одной и той же подсети.
С ARP-Flux я разобрался, tcpdump'ом вижу, что ARP-ответы шлются через верные интерфейсы. Но после начинается ерунда с маршрутизацией, пакеты приходят на один интерфейс, а ответ уходит через другой, с другого ip-адреса. Причем, разумеется, с другим mac-адресом.
Хочется что бы всё было «нормально» - отвечало через тот же интерфейс, через который пришёл запрос, с ip-адреса интерфейса. Понимаю, что хочется странного, но может кто подскажет как такое реализовать? Подозреваю что при помощи policy based routing, но может есть способ проще? А если нет - то может кто подскажет как при помощи неё?
Доп. инфо:
Сетевые интерфейсы
[root@alarmpi ~]# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.192 netmask 255.255.255.0 broadcast 192.168.1.255
ether b8:27:eb:50:e7:ad txqueuelen 1000 (Ethernet)
RX packets 1414 bytes 92808 (90.6 KiB)
RX errors 0 dropped 2 overruns 0 frame 0
TX packets 1522 bytes 201782 (197.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@alarmpi ~]# ifconfig wlan0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.181 netmask 255.255.255.0 broadcast 192.168.1.255
ether f8:1a:67:07:08:dd txqueuelen 1000 (Ethernet)
RX packets 1236 bytes 369079 (360.4 KiB)
RX errors 0 dropped 28 overruns 0 frame 0
TX packets 36 bytes 5003 (4.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Маршруты:
[root@alarmpi ~]# ip ro sh
default via 192.168.1.1 dev eth0 metric 204
default via 192.168.1.1 dev wlan0 metric 305
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.192 metric 204
192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.181 metric 305
sysctl:
net.ipv4.conf.all.accept_local = 0
net.ipv4.conf.all.accept_redirects = 1
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.all.arp_accept = 0
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.all.arp_filter = 0
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_notify = 0
net.ipv4.conf.all.bootp_relay = 0
net.ipv4.conf.all.disable_policy = 0
net.ipv4.conf.all.disable_xfrm = 0
net.ipv4.conf.all.force_igmp_version = 0
net.ipv4.conf.all.forwarding = 0
net.ipv4.conf.all.log_martians = 0
net.ipv4.conf.all.mc_forwarding = 0
net.ipv4.conf.all.medium_id = 0
net.ipv4.conf.all.promote_secondaries = 0
net.ipv4.conf.all.proxy_arp = 0
net.ipv4.conf.all.proxy_arp_pvlan = 0
net.ipv4.conf.all.route_localnet = 0
net.ipv4.conf.all.rp_filter = 0
net.ipv4.conf.all.secure_redirects = 1
net.ipv4.conf.all.send_redirects = 1
net.ipv4.conf.all.shared_media = 1
net.ipv4.conf.all.src_valid_mark = 0
net.ipv4.conf.all.tag = 0
net.ipv4.conf.eth0.accept_local = 0
net.ipv4.conf.eth0.accept_redirects = 1
net.ipv4.conf.eth0.accept_source_route = 0
net.ipv4.conf.eth0.arp_accept = 0
net.ipv4.conf.eth0.arp_announce = 0
net.ipv4.conf.eth0.arp_filter = 0
net.ipv4.conf.eth0.arp_ignore = 0
net.ipv4.conf.eth0.arp_notify = 0
net.ipv4.conf.eth0.bootp_relay = 0
net.ipv4.conf.eth0.disable_policy = 0
net.ipv4.conf.eth0.disable_xfrm = 0
net.ipv4.conf.eth0.force_igmp_version = 0
net.ipv4.conf.eth0.forwarding = 0
net.ipv4.conf.eth0.log_martians = 0
net.ipv4.conf.eth0.mc_forwarding = 0
net.ipv4.conf.eth0.medium_id = 0
net.ipv4.conf.eth0.promote_secondaries = 1
net.ipv4.conf.eth0.proxy_arp = 0
net.ipv4.conf.eth0.proxy_arp_pvlan = 0
net.ipv4.conf.eth0.route_localnet = 0
net.ipv4.conf.eth0.rp_filter = 0
net.ipv4.conf.eth0.secure_redirects = 1
net.ipv4.conf.eth0.send_redirects = 1
net.ipv4.conf.eth0.shared_media = 1
net.ipv4.conf.eth0.src_valid_mark = 0
net.ipv4.conf.eth0.tag = 0
net.ipv4.conf.wlan0.accept_local = 0
net.ipv4.conf.wlan0.accept_redirects = 1
net.ipv4.conf.wlan0.accept_source_route = 0
net.ipv4.conf.wlan0.arp_accept = 0
net.ipv4.conf.wlan0.arp_announce = 0
net.ipv4.conf.wlan0.arp_filter = 0
net.ipv4.conf.wlan0.arp_ignore = 0
net.ipv4.conf.wlan0.arp_notify = 0
net.ipv4.conf.wlan0.bootp_relay = 0
net.ipv4.conf.wlan0.disable_policy = 0
net.ipv4.conf.wlan0.disable_xfrm = 0
net.ipv4.conf.wlan0.force_igmp_version = 0
net.ipv4.conf.wlan0.forwarding = 0
net.ipv4.conf.wlan0.log_martians = 0
net.ipv4.conf.wlan0.mc_forwarding = 0
net.ipv4.conf.wlan0.medium_id = 0
net.ipv4.conf.wlan0.promote_secondaries = 1
net.ipv4.conf.wlan0.proxy_arp = 0
net.ipv4.conf.wlan0.proxy_arp_pvlan = 0
net.ipv4.conf.wlan0.route_localnet = 0
net.ipv4.conf.wlan0.rp_filter = 0
net.ipv4.conf.wlan0.secure_redirects = 1
net.ipv4.conf.wlan0.send_redirects = 1
net.ipv4.conf.wlan0.shared_media = 1
net.ipv4.conf.wlan0.src_valid_mark = 0
net.ipv4.conf.wlan0.tag = 0
arp-reply:
[root@alarmpi ~]# tcpdump -ni wlan0 arp
00:10:00.586376 ARP, Request who-has 192.168.1.181 tell 192.168.1.17, length 46
00:10:00.586535 ARP, Reply 192.168.1.181 is-at f8:1a:67:07:08:dd, length 28
[root@alarmpi ~]# tcpdump -ni eth0 arp
00:11:18.026342 ARP, Request who-has 192.168.1.192 tell 192.168.1.17, length 46
00:11:18.026447 ARP, Reply 192.168.1.192 is-at b8:27:eb:50:e7:ad, length 28
пинги:
[root@alarmpi ~]# tcpdump -nei wlan0 icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on wlan0, link-type EN10MB (Ethernet), capture size 65535 bytes
00:33:44.018351 00:24:1d:df:c6:8e > f8:1a:67:07:08:dd, ethertype IPv4 (0x0800), length 74: 192.168.1.17 > 192.168.1.181: ICMP echo request, id 1, seq 1295, length 40
00:33:45.018072 00:24:1d:df:c6:8e > f8:1a:67:07:08:dd, ethertype IPv4 (0x0800), length 74: 192.168.1.17 > 192.168.1.181: ICMP echo request, id 1, seq 1296, length 40
^C
2 packets captured
2 packets received by filter
0 packets dropped by kernel
[root@alarmpi ~]# tcpdump -nei eth0 icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
00:33:50.023437 b8:27:eb:50:e7:ad > 00:24:1d:df:c6:8e, ethertype IPv4 (0x0800), length 74: 192.168.1.181 > 192.168.1.17: ICMP echo reply, id 1, seq 1301, length 40
00:33:51.024437 b8:27:eb:50:e7:ad > 00:24:1d:df:c6:8e, ethertype IPv4 (0x0800), length 74: 192.168.1.181 > 192.168.1.17: ICMP echo reply, id 1, seq 1302, length 40
^C
2 packets captured
2 packets received by filter
0 packets dropped by kernel
Заранее спасибо.