Hi,

If your gateway performs as L3 gateway and your app replies s1-eth0 MAC,
you need to rewrite src MAC to s1-eth1 MAC and dst MAC to h2 MAC at your gateway
in order to communicate IP packets from h1 and h2, I guess.

If your gateway performs as L2 gateway, your app should reply h2 MAC for h1's 
ARP
request.

Thanks,
Iwase

On 2016年08月25日 10:18, Warsang wrote:
> Hello everyone, I am trying to code a fake gateway to send packets between 
> h1(10.1.1.2) and h2(10.1.4.2) in mininet
>
> My gateway has two interfaces, one in 10.1.1.0/24 (ip: 10.1.1.1) and one in 
> 10.1.4.0/24 (ip:10.1.4.1)
>
> I am trying with h1 to download a video from apache webserver running on h2.
>
> When I do so, h1 sends an ARP request to find who has 10.1.1.1?
>  I already coded a function to reply to these arp requests and my switch 
> answers: 00:00:00:00:00:01 (S1-eth0 mac)
>
> Now h1 sends TCP packets with src 10.1.1.2 to 10.1.4.2 and h2 receives them 
> but drops them because the dst mac is 00:00:00:00:00:01. I added something to 
> change the mac to 00:00:00:00:00:02 in my code but so far it is not working 
> and the mac stays 00:00:00:00:00:01 according to tcpdump.
>
> Could someone please tell me if my reasoning is wrong? Moreover what is wrong 
> with my code? If there is a working example of something similar could you 
> please send me a link? I found the ryu rest router but it is not very prone 
> to modification which is why I started coding this.
>
>
> My code is in the py file attached.
>
> (You will have to configure routing for h1 and h2 in order for s1 to get 
> packets)
> Thank you in advance.
>
> Regards,
>
> warsang
>
>
>
>
> ------------------------------------------------------------------------------
>
>
>
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>

------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to