1

I ssh into a linux machine using nets namespace (command below)

ip netns exec NAME_SPACE ssh root@192.168.2.100

From there I want to execute some command(say "ifconfig") in default name space from this.

1 Answers1

3

If you know that a process is running in the default network namespace (typically process number 1), you can use tools like nsenter to run a command in the same network namespace (-n option):

# nsenter -t 1 -n ifconfig
Rachid K.
  • 4,490
  • 3
  • 11
  • 30