You'll have to monitor the veth-a interface. (You can also use the MASQUERADE rule if you prefer)įinally, you can run the process you want to analyze in the new namespace, and wireshark too: ip netns exec test thebinarytotest Iptables -t nat -A POSTROUTING -s 192.168.163.0/24 -o YOURNETWORKINTERFACE -j SNAT -to-source YOURIPADDRESS The w command shows information about the Linux users currently on the server, and their running processes. Ifconfig veth-b up 192.168.163.254 netmask 255.255.255.0Ĭonfigure the routing in the test namespace: ip netns exec test route add default gw 192.168.163.254 dev veth-aĪctivate ip_forward and establish a NAT rule to forward the traffic coming in from the namespace you created (you have to adjust the network interface and SNAT ip address): echo 1 > /proc/sys/net/ipv4/ip_forward This will probably be more convenient than reading the strace log:Ĭreate a test network namespace: ip netns add testĬreate a pair of virtual network interfaces (veth-a and veth-b): ip link add veth-a type veth peer name veth-bĬhange the active namespace of the veth-a interface: ip link set veth-a netns testĬonfigure the IP addresses of the virtual interfaces: ip netns exec test ifconfig veth-a up 192.168.163.1 netmask 255.255.255.0 Data ONTAP provides the following commands that you can use to view network. Otherwise, but that's specific to Linux, you can run the process in an isolated network namespace and use wireshark to monitor the traffic. If you’re managing a Linux server, it’s good to be ready with a number of commands that you can use to check user activity when your users are logging in and how often, what groups they. active sockets, memory buffer, protocol-specific statistics, routing tables. To monitor an existing process with a known PID: strace -p $PID -f -e trace=network -s 10000 To start and monitor an new process: strace -f -e trace=network -s 10000 PROCESS ARGUMENTS I found this answer on askubuntu, but it's valid for Unix:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |