Sorry Tommasso about the less details about the questions
Topology:
RH---------------Node1-----------------------{ Network1}
|
|
|
{Network2}
I need to apply NAT on Node1, for IPs coming from Network1. This is followed by applying a NAT on Node1 again, but for IPs comings from Network2 this time. I can apply NAT on Node1 either for Network1 or Network2. Not both at same time. If I try to apply to both Network on same Node1, I get below error
"Object::AggregateObject(): Multiple aggregation of objects of type ns3::Ipv4Nat".
The error happens as NAT is applied on same node 2 times.
Below is the code for NAT on Node1 from Network1
Ptr<Ipv4Nat> nat = natHelper.Install (Node1);
nat->SetInside (1);
nat->SetOutside (2);
Ipv4StaticNatRule rule0 (Ipv4Address ("7.0.0.3"), 49153, Ipv4Address ("1.0.0.1"), 3005, 0);
nat->AddStaticRule (rule0);
For Network2
Below is the code for NAT on Node1 from Network2
Ptr<Ipv4Nat> nat1 = natHelper.Install (Node1);
nat1->SetInside (1);
nat1->SetOutside (2);
Ipv4StaticNatRule rule1 (Ipv4Address ("8.0.0.3"), 49153, Ipv4Address ("1.0.0.1"), 3006, 0);
nat->AddStaticRule (rule1);
My question: Is there any way to reset or delete, the operation performed on Node1 for Network1, before I do it for network2.? I mean remove Nat, so that Nat1 will be the only on Node1 with NAT while applying.
Cheers,
T