Multiple Network Cards with the same Inet Address and Socket connections

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I am currently working on a program that needs to have multiple Wireless Network cards that can communicate to different devices at the same time on the same port. Currently, when I try and connect to the socket, it uses the default card, and no matter what I do, the second connection fails since it's trying to use the same socket on the same network card. Basically, I think I need a way to completely separate the two network cards. I am unsure how to go about doing this though, I know the solution might involve IP tables. Thanks



Current setup



1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 10:7b:44:7b:09:84 brd ff:ff:ff:ff:ff:ff
inet 10.1.10.126/24 brd 10.1.10.255 scope global dynamic noprefixroute enp3s0
valid_lft 603140sec preferred_lft 603140sec
inet6 2603:3004:776:2000::a426/128 scope global dynamic noprefixroute
valid_lft 603143sec preferred_lft 603143sec
inet6 2603:3004:776:2000:4c2f:a5a0:4a46:157f/64 scope global temporary dynamic
valid_lft 345598sec preferred_lft 84734sec
inet6 2603:3004:776:2000:39ff:407f:32ae:ea8b/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 345598sec preferred_lft 345598sec
inet6 fe80::45a1:765:4ea:18cb/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: wlp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether d4:6e:0e:10:32:95 brd ff:ff:ff:ff:ff:ff
inet 200.100.200.20/24 brd 200.100.200.255 scope global dynamic noprefixroute wlp1s0
valid_lft 298sec preferred_lft 298sec
inet6 fe80::7fcd:ba35:3541:639e/64 scope link noprefixroute
valid_lft forever preferred_lft forever
4: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 7c:8b:ca:0a:11:de brd ff:ff:ff:ff:ff:ff
inet 200.100.200.20/24 brd 200.100.200.255 scope global dynamic noprefixroute wlp2s0
valid_lft 298sec preferred_lft 298sec
inet6 fe80::c503:ddbe:74f4:3f0f/64 scope link noprefixroute
valid_lft forever preferred_lft forever



default via 10.1.10.1 dev enp3s0 proto dhcp metric 100
10.1.10.0/24 dev enp3s0 proto kernel scope link src 10.1.10.126 metric 100
169.254.0.0/16 dev wlp2s0 scope link metric 1000
200.100.200.0/24 dev wlp1s0 proto kernel scope link src 200.100.200.20 metric 600
200.100.200.0/24 dev wlp2s0 proto kernel scope link src 200.100.200.20 metric 601



sudo arp-scan --interface=wlp1s0 --localnet
Interface: wlp1s0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.9 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)
200.100.200.1 f0:45:da:29:ed:c7 (Unknown)



sudo arp-scan --interface=wlp2s0 --localnet
Interface: wlp2s0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.9 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)
200.100.200.1 50:f1:4a:f6:c3:0e (Unknown)











share|improve this question









New contributor




Nark is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    up vote
    0
    down vote

    favorite












    I am currently working on a program that needs to have multiple Wireless Network cards that can communicate to different devices at the same time on the same port. Currently, when I try and connect to the socket, it uses the default card, and no matter what I do, the second connection fails since it's trying to use the same socket on the same network card. Basically, I think I need a way to completely separate the two network cards. I am unsure how to go about doing this though, I know the solution might involve IP tables. Thanks



    Current setup



    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
    valid_lft forever preferred_lft forever
    2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 10:7b:44:7b:09:84 brd ff:ff:ff:ff:ff:ff
    inet 10.1.10.126/24 brd 10.1.10.255 scope global dynamic noprefixroute enp3s0
    valid_lft 603140sec preferred_lft 603140sec
    inet6 2603:3004:776:2000::a426/128 scope global dynamic noprefixroute
    valid_lft 603143sec preferred_lft 603143sec
    inet6 2603:3004:776:2000:4c2f:a5a0:4a46:157f/64 scope global temporary dynamic
    valid_lft 345598sec preferred_lft 84734sec
    inet6 2603:3004:776:2000:39ff:407f:32ae:ea8b/64 scope global dynamic mngtmpaddr noprefixroute
    valid_lft 345598sec preferred_lft 345598sec
    inet6 fe80::45a1:765:4ea:18cb/64 scope link noprefixroute
    valid_lft forever preferred_lft forever
    3: wlp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether d4:6e:0e:10:32:95 brd ff:ff:ff:ff:ff:ff
    inet 200.100.200.20/24 brd 200.100.200.255 scope global dynamic noprefixroute wlp1s0
    valid_lft 298sec preferred_lft 298sec
    inet6 fe80::7fcd:ba35:3541:639e/64 scope link noprefixroute
    valid_lft forever preferred_lft forever
    4: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 7c:8b:ca:0a:11:de brd ff:ff:ff:ff:ff:ff
    inet 200.100.200.20/24 brd 200.100.200.255 scope global dynamic noprefixroute wlp2s0
    valid_lft 298sec preferred_lft 298sec
    inet6 fe80::c503:ddbe:74f4:3f0f/64 scope link noprefixroute
    valid_lft forever preferred_lft forever



    default via 10.1.10.1 dev enp3s0 proto dhcp metric 100
    10.1.10.0/24 dev enp3s0 proto kernel scope link src 10.1.10.126 metric 100
    169.254.0.0/16 dev wlp2s0 scope link metric 1000
    200.100.200.0/24 dev wlp1s0 proto kernel scope link src 200.100.200.20 metric 600
    200.100.200.0/24 dev wlp2s0 proto kernel scope link src 200.100.200.20 metric 601



    sudo arp-scan --interface=wlp1s0 --localnet
    Interface: wlp1s0, datalink type: EN10MB (Ethernet)
    Starting arp-scan 1.9 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)
    200.100.200.1 f0:45:da:29:ed:c7 (Unknown)



    sudo arp-scan --interface=wlp2s0 --localnet
    Interface: wlp2s0, datalink type: EN10MB (Ethernet)
    Starting arp-scan 1.9 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)
    200.100.200.1 50:f1:4a:f6:c3:0e (Unknown)











    share|improve this question









    New contributor




    Nark is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I am currently working on a program that needs to have multiple Wireless Network cards that can communicate to different devices at the same time on the same port. Currently, when I try and connect to the socket, it uses the default card, and no matter what I do, the second connection fails since it's trying to use the same socket on the same network card. Basically, I think I need a way to completely separate the two network cards. I am unsure how to go about doing this though, I know the solution might involve IP tables. Thanks



      Current setup



      1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      inet 127.0.0.1/8 scope host lo
      valid_lft forever preferred_lft forever
      inet6 ::1/128 scope host
      valid_lft forever preferred_lft forever
      2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
      link/ether 10:7b:44:7b:09:84 brd ff:ff:ff:ff:ff:ff
      inet 10.1.10.126/24 brd 10.1.10.255 scope global dynamic noprefixroute enp3s0
      valid_lft 603140sec preferred_lft 603140sec
      inet6 2603:3004:776:2000::a426/128 scope global dynamic noprefixroute
      valid_lft 603143sec preferred_lft 603143sec
      inet6 2603:3004:776:2000:4c2f:a5a0:4a46:157f/64 scope global temporary dynamic
      valid_lft 345598sec preferred_lft 84734sec
      inet6 2603:3004:776:2000:39ff:407f:32ae:ea8b/64 scope global dynamic mngtmpaddr noprefixroute
      valid_lft 345598sec preferred_lft 345598sec
      inet6 fe80::45a1:765:4ea:18cb/64 scope link noprefixroute
      valid_lft forever preferred_lft forever
      3: wlp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
      link/ether d4:6e:0e:10:32:95 brd ff:ff:ff:ff:ff:ff
      inet 200.100.200.20/24 brd 200.100.200.255 scope global dynamic noprefixroute wlp1s0
      valid_lft 298sec preferred_lft 298sec
      inet6 fe80::7fcd:ba35:3541:639e/64 scope link noprefixroute
      valid_lft forever preferred_lft forever
      4: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
      link/ether 7c:8b:ca:0a:11:de brd ff:ff:ff:ff:ff:ff
      inet 200.100.200.20/24 brd 200.100.200.255 scope global dynamic noprefixroute wlp2s0
      valid_lft 298sec preferred_lft 298sec
      inet6 fe80::c503:ddbe:74f4:3f0f/64 scope link noprefixroute
      valid_lft forever preferred_lft forever



      default via 10.1.10.1 dev enp3s0 proto dhcp metric 100
      10.1.10.0/24 dev enp3s0 proto kernel scope link src 10.1.10.126 metric 100
      169.254.0.0/16 dev wlp2s0 scope link metric 1000
      200.100.200.0/24 dev wlp1s0 proto kernel scope link src 200.100.200.20 metric 600
      200.100.200.0/24 dev wlp2s0 proto kernel scope link src 200.100.200.20 metric 601



      sudo arp-scan --interface=wlp1s0 --localnet
      Interface: wlp1s0, datalink type: EN10MB (Ethernet)
      Starting arp-scan 1.9 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)
      200.100.200.1 f0:45:da:29:ed:c7 (Unknown)



      sudo arp-scan --interface=wlp2s0 --localnet
      Interface: wlp2s0, datalink type: EN10MB (Ethernet)
      Starting arp-scan 1.9 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)
      200.100.200.1 50:f1:4a:f6:c3:0e (Unknown)











      share|improve this question









      New contributor




      Nark is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I am currently working on a program that needs to have multiple Wireless Network cards that can communicate to different devices at the same time on the same port. Currently, when I try and connect to the socket, it uses the default card, and no matter what I do, the second connection fails since it's trying to use the same socket on the same network card. Basically, I think I need a way to completely separate the two network cards. I am unsure how to go about doing this though, I know the solution might involve IP tables. Thanks



      Current setup



      1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      inet 127.0.0.1/8 scope host lo
      valid_lft forever preferred_lft forever
      inet6 ::1/128 scope host
      valid_lft forever preferred_lft forever
      2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
      link/ether 10:7b:44:7b:09:84 brd ff:ff:ff:ff:ff:ff
      inet 10.1.10.126/24 brd 10.1.10.255 scope global dynamic noprefixroute enp3s0
      valid_lft 603140sec preferred_lft 603140sec
      inet6 2603:3004:776:2000::a426/128 scope global dynamic noprefixroute
      valid_lft 603143sec preferred_lft 603143sec
      inet6 2603:3004:776:2000:4c2f:a5a0:4a46:157f/64 scope global temporary dynamic
      valid_lft 345598sec preferred_lft 84734sec
      inet6 2603:3004:776:2000:39ff:407f:32ae:ea8b/64 scope global dynamic mngtmpaddr noprefixroute
      valid_lft 345598sec preferred_lft 345598sec
      inet6 fe80::45a1:765:4ea:18cb/64 scope link noprefixroute
      valid_lft forever preferred_lft forever
      3: wlp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
      link/ether d4:6e:0e:10:32:95 brd ff:ff:ff:ff:ff:ff
      inet 200.100.200.20/24 brd 200.100.200.255 scope global dynamic noprefixroute wlp1s0
      valid_lft 298sec preferred_lft 298sec
      inet6 fe80::7fcd:ba35:3541:639e/64 scope link noprefixroute
      valid_lft forever preferred_lft forever
      4: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
      link/ether 7c:8b:ca:0a:11:de brd ff:ff:ff:ff:ff:ff
      inet 200.100.200.20/24 brd 200.100.200.255 scope global dynamic noprefixroute wlp2s0
      valid_lft 298sec preferred_lft 298sec
      inet6 fe80::c503:ddbe:74f4:3f0f/64 scope link noprefixroute
      valid_lft forever preferred_lft forever



      default via 10.1.10.1 dev enp3s0 proto dhcp metric 100
      10.1.10.0/24 dev enp3s0 proto kernel scope link src 10.1.10.126 metric 100
      169.254.0.0/16 dev wlp2s0 scope link metric 1000
      200.100.200.0/24 dev wlp1s0 proto kernel scope link src 200.100.200.20 metric 600
      200.100.200.0/24 dev wlp2s0 proto kernel scope link src 200.100.200.20 metric 601



      sudo arp-scan --interface=wlp1s0 --localnet
      Interface: wlp1s0, datalink type: EN10MB (Ethernet)
      Starting arp-scan 1.9 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)
      200.100.200.1 f0:45:da:29:ed:c7 (Unknown)



      sudo arp-scan --interface=wlp2s0 --localnet
      Interface: wlp2s0, datalink type: EN10MB (Ethernet)
      Starting arp-scan 1.9 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)
      200.100.200.1 50:f1:4a:f6:c3:0e (Unknown)








      networking wifi socket






      share|improve this question









      New contributor




      Nark is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Nark is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 10 mins ago





















      New contributor




      Nark is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 23 mins ago









      Nark

      11




      11




      New contributor




      Nark is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Nark is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Nark is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          Nark is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f476410%2fmultiple-network-cards-with-the-same-inet-address-and-socket-connections%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          Nark is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          Nark is a new contributor. Be nice, and check out our Code of Conduct.












          Nark is a new contributor. Be nice, and check out our Code of Conduct.











          Nark is a new contributor. Be nice, and check out our Code of Conduct.













           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f476410%2fmultiple-network-cards-with-the-same-inet-address-and-socket-connections%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay