AnswerBun.com

Two Interfaces and lost packages

Super User Asked by cicekadam on July 26, 2020

I have two ethernet interfaces named enp1s0f0 and enp1s0f1. They have ip addresses from same subnet (don’t think it matters tho). Here is scenario:

My distro is Centos8

I have done "echo 1 > /proc/sys/net/ipv4/ip_forward"

enp1s0f0 has x.y.z.236
enp1s0f1 has x.y.z.237

i have written ip rule

[[email protected] ~]# ip rule list
0:      from all lookup local
32762:  from all to x.y.z.237 lookup 237

and my additional routing table 237

[[email protected] ~]# ip route list table 237
default via x.y.z.254 dev enp1s0f1
x.y.z.0/24 dev enp1s0f1 scope link src x.y.z.237

Here is my problem: first interface works well, for second interface i can see coming packets by tcpdump but nftables counters are not counting up. For example an ssh connection just go timeout. I have tried "meta nftrace set 1" for input and forward hooks but nothing passes here too.

Here is my tcpdump out:

[[email protected] ~]# tcpdump -i enp1s0f1 port 22 -n
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp1s0f1, link-type EN10MB (Ethernet), capture size 262144 bytes
17:13:01.305452 IP x.y.z.3.52229 > x.y.z.237.ssh: Flags [S], seq 2642985606, win 8192, options [mss 1428,nop,wscale 8,nop,nop,sackOK], length 0
17:13:04.305689 IP x.y.z.3.52229 > x.y.z.237.ssh: Flags [S], seq 2642985606, win 8192, options [mss 1428,nop,wscale 8,nop,nop,sackOK], length 0
17:13:10.306349 IP x.y.z.3.52229 > x.y.z.237.ssh: Flags [S], seq 2642985606, win 8192, options [mss 1428,nop,nop,sackOK], length 0

And here is my nftables rules:

table ip filter {
        chain INPUT {
                type filter hook input priority filter; policy accept;
                ip daddr x.y.z.237 tcp dport 22 meta nftrace set 1 counter packets 0 bytes 0


        chain FORWARD {
                type filter hook forward priority filter; policy accept;
                counter packets 0 bytes 0 accept

        chain OUTPUT {
                type filter hook output priority filter; policy accept;
                ip saddr x.y.z.236 tcp sport 22 counter packets 383 bytes 102888 accept
                ip saddr x.y.z.237 tcp sport 22 counter packets 0 bytes 0 accept

What am i missing? Where my packages go?

One Answer

I figured it out. When I added ip rule add from x.y.z.237/32 table 237 it worked. Didn't understand why tho :D But it does the job, so no problem.

Answered by cicekadam on July 26, 2020

Add your own answers!

Related Questions

Creating a symbolic link to mapped network drive in Windows

8  Asked on December 31, 2020 by vegard-larsen

   

Bash files open terminal when opened

1  Asked on December 31, 2020 by chris-smith

   

S3 command not working in cron

1  Asked on December 31, 2020 by kargirwar

       

Scale to fit option

6  Asked on December 30, 2020 by steven-penny

 

After downloading Tweepy I don’t know where to locate it

1  Asked on December 30, 2020 by candle

 

Excel COUNTIF with non-contiguous named ranges

1  Asked on December 30, 2020 by malan88

 

How to bypass Windows 10 PIN complexity requirement

1  Asked on December 29, 2020 by some-user

   

Resume uploading with built-in Windows FTP client

1  Asked on December 29, 2020 by vlad-novakovsky

   

What is the Windows analog of the Linux watch command?

15  Asked on December 29, 2020 by peterjclaw

     

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP