Network Emulator (Netem) on Ubuntu 16.04 - linux

Hello I'm new to Linux,
I have a Linux VM with Ubuntu 16.04 loaded onto it. I'm trying to use a Network Emulator called Netem to delay packets.
However when I run the ping command after I put in the delay rule, there appears to be no delay. (see screenshot)
Screenshot of terminal
Below is my attempt at debugging the issue:
I know that usually there is eth0,eth1, etc. However when I run,
ifconfig there is no eth0 listed, just ens33.
So I substituted ens33 and ran the command below to add the delay.
sudo tc qdisc add dev ens33 root netem delay 350ms
Next I ping the VM to verify the delay has been added. But the result is the same as before the delay rule was added.
ping 192.168.126.130.
Can someone please give me input as to what my issue is?

Since you're running in a VM, your network device may not be eth0. If you're attempting to ping localhost, then it will be using the lo device since it's not trying to reach a remote network address. Try applying the rule to lo or ping a remote address.

Related

How to access a raspberry pi localhost from a linux?

I set up a php file in my raspberry pi so that I can access some files on it from my local network.
Within raspbian, it works well in any browser using localhost/test. I tested it also in a Windows and a Mac computer in the same network, using my.local.ip.address/test in my browsers and it also worked fine.
Now here is the problem: in my linux computer, it does not work. It simply says that "the site cannot be reached". I already tried disabling the firewall (UFW) but it doesn't change anything.
I also tried several browsers in linux and the result is the same.
I think I am overseeing something obvious but I cannot see it.
Could someone give me a pointer on what might be wrong?
ifconfig -a output (Linux machine)
ifconfig -a output (Raspberry Pi machine)
It's possible that your Ubuntu machine is not in the same network. You can try theses steps to confirm :
Ping
Go on your ubuntu machine and type :
ping <rasp.pi.local.ip.address>
Go on your Raspberry Pi and type :
ping <ubuntu.local.ip.address>
If the ping request do not succeed your machines are probably in different networks. Your can use this command to watch the path used by packets between your ubuntu machine and your Raspberry Pi :
traceroute <rasp.pi.local.ip.address>
Change network card settings
Before this step, check if your are able to connect your machines togather (switch, router, vlan...).
ifconfig <interface> down
ifconfig <interface> <ip.network> netmask <netmask.network>
ifconfig <interface> up
After completing theses steps try to ping again and access to your website.

ping: unknown host in Centos 6.6

It's OK to ping IP address.
picture about ping and cat /etc/resolve.conf
I can ping 8.8.8.8, so the DNS server is OK to reach, and /etc/resolv.conf edited correctly. But I just can't ping domain. I've tried shutdown firewall but failed. Too strange, I used service iptables stop and iptables was still there.
Two problems:
1. unknown host
2. stop iptables failed.
Anyone can tell me how to fix these?
I solved this problem by accident and I don't know if it's copyable, but I need to write it down.
1. I set /etc/hosts to run command `yum install bind-utils`.
2. then, I run command `dig +trace www.baidu.com` to find out why ping fail.
then, miracle happens. I can ping domain again. The problem solved magically just as it occurred.

How to configure internet on CentOS installation on VirtualBox

I am a beginner to linux. I have done the fresh installation of CentOS 7 on my Windows VirtualBox.
Over the tutorials for CentOs 6 they have mentioned to edit /etc/sysconfig/network-scripts/ifcfg-eth0 file for the configurations.
But in my installation there is no such file. I have ifcfg-enp0s3 and ifcfg-lo files available.
From the CentOS tutorial, the eth0 portion of /etc/sysconfig/network-scripts/ifcfg-eth0 refers to the network interface. eth0 is the most common name for a standard ethernet interface in Linux. From your question, your system has two interfaces: enp0s3 and lo. lo is the loopback interface, so ignore that one. That leaves enp0s3.
Go ahead and follow the instructions with /etc/sysconfig/network-scripts/ifcfg-enp0s3. It should work, assuming that interface doesn't have any weird quirks associated with it.
Same here! I installed CentOS 7 in Windows7 Virtulabox, there is no eth0, but enp0s3.
After first reboot, used command ip addr, enp0s3 had no ip address
bundled;
Then I updated /etc/sysconfig/network-scripts/ifcfg-enp0s3, changed ONBOOT=no to ONBOOT=yes, enp0s3 had ip 10.x.x.x, still useless;
Then I updated /etc/sysconfig/network-scripts/ifcfg-enp0s3 according to the accepted answer of centos minimal installation static ip address, it works!
As my IP address of Ethernet adapter VirtualBox Host-Only Network is 192.168.56.1, I set 192.168.56.35 to enp0s3, and my vbox NIC mode is Host-Only.
Type nmtui in the terminal
Go to 'edit connection' and hit enter
Select 'enp0s3' and hit enter
Go down to 'Automatically connect' using down arrow key
Press space bar
Go down and press hit enter on 'Ok'
Go back and quit
It worked for me like this on windows 10 -Change Adapter 1 Name to "Remote NDIS based Internet Sharing Device"

multicast traffic fails with virtualbox host only network

I have an application where it sends some multicast request to the multicast group ,
If I test my Client and Server application on two separate PC which are in same subnet it works fine .
Since I can not run always on two PCs during testing of my application, I thought of using the virtualbox to run the another OS to run my server application .
My Host is ubuntu , I installed the vitrtualbox to run the another guest os linux , and since my traffic only has to be with in the HOST and Guest , I have selected a "host only network type" .
My guest OS get the IP address but when I run my server application, It fails to join to the multicast group says
"No Such Device" .
Can someone help me to set up a network between the Guest and HOST OS ..
My main goal is to send a multicast request and it should reach the guest OS.
In VM:
ls /sys/class/net - get net devices. (lo, eth0, eth1...). You should have one lo and two eth devices.
sudo nano /etc/network/interfaces. At eth0 there is a NAT connection. Lo is a localhost. We should set the Host-Only connection. Add the following:
# The host-only network interface
auto eth1
iface eth1 inet static
address 192.168.56.101
netmask 255.255.255.0
network 192.168.56.0
broadcast 192.168.56.255
(Address is taken from ipconfig/ifconfig output in host system. Instead eth1 you can have another connection name, taken from the step 4.b.i)
For checking the edited file, run:
sudo service network-manager restart
Check if you have all three connections running. Check Host-Only addresses.
ifconfig
Reboot
sudo reboot

Configuring ethernet or wifi inernet on centos

How do i configure ethernet or wifi on laptop, i followed this tutorial and my ethernet started properly and still i couldn't receive any packet from ping 8.8.8.8 dns, i have ethernet and wifi on my laptop... same setting on virtual machine works perfectl but on real os it wouldn't work... if i ping
ping 127.0.0.1
or
ping localhost
what could be the problem???
It could be that your interface is down.
ifconfig eth0 up
Eth0 is an interface name to get the list of your visible interface type in "ifconfig"
also you should provide us with the list of interface and possibly also hardware
dmesg
will display the full list of device on your laptop.
Also to be noted some of these command requires root / sudoer.
Wifi : http://wiki.centos.org/HowTos/Laptops/Wireless

Resources