Skip to content

ip netns support added to hosts#1193

Open
htanwar922 wants to merge 8 commits intomininet:masterfrom
i2Sage-IIT-Delhi:master
Open

ip netns support added to hosts#1193
htanwar922 wants to merge 8 commits intomininet:masterfrom
i2Sage-IIT-Delhi:master

Conversation

@htanwar922
Copy link

class Host in node.py is modified as follows:

  • inherited function startShell is extended to create a symlink to /proc/<host-pid>/nsnet in /var/run/netns with name convention mininet:<host-name> .
  • inherited function terminate is extended to remove the hence created symlink.

For example, /var/run/netns/mininet:h1 for host h1.

This removes the need for extracting host-pid for running

mnexec -da <host-pid==??> zsh -ils

and the other nuissance associated with it like captured KeyboardInterrupt, etc.

This also replaces the xterm h1 and gterm h1 in case one wishes to use any other terminal like QTerminal in Kali for this.

Now the net-namespace of h1 can be accessed as:

ip netns exec mininet:h1 zsh -ils

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant