Can't ping two adhoc wireless lop tops (linux) - linux

I want to run an ad-hoc wireless on two lop tops that both of them have Linux OS. I use this for creating ad-hoc network.(I have stopped Network Manager before it)
sudo ifconfig wlan0 down
sudo iwconfig wlan0 mode ad-hoc essid test-adhoc channel 3
sudo ifconfig wlan0 up
sudo ifconfig wlan0 192.168.1.1 netmask 255.255.255.0
My ifconfig:
ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:25388 errors:0 dropped:0 overruns:0 frame:0
TX packets:25388 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3916018 (3.9 MB) TX bytes:3916018 (3.9 MB)
vmnet1 Link encap:Ethernet HWaddr 00:50:56:c0:00:01
inet addr:192.168.237.1 Bcast:192.168.237.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fec0:1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:505 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
vmnet8 Link encap:Ethernet HWaddr 00:50:56:c0:00:08
inet addr:172.16.62.1 Bcast:172.16.62.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fec0:8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:504 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wlan0 Link encap:Ethernet HWaddr ac:72:89:1b:19:76
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::ae72:89ff:fe1b:1976/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1543085 errors:0 dropped:27 overruns:0 frame:0
TX packets:19353 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:183406489 (183.4 MB) TX bytes:3741745 (3.7 MB)
And iwconfig
vmnet8 no wireless extensions.
eth0 no wireless extensions.
lo no wireless extensions.
wlan0 IEEE 802.11bgn ESSID:"test-adhoc"
Mode:Ad-Hoc Frequency:2.422 GHz Cell: A2:A3:E3:9B:6A:FA
Tx-Power=15 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Power Management:off
vmnet1 no wireless extensions.
IP for first Lop top is <192.168.1.1> and for second one is <192.168.1.2>. I checked the route:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.62.0 * 255.255.255.0 U 0 0 0 vmnet8
192.168.1.0 * 255.255.255.0 U 0 0 0 wlan0
192.168.237.0 * 255.255.255.0 U 0 0 0 vmnet1
But when i ping one from other:
ping 192.168.1.2
PING 192.168.1.2 (192.168.1.2) 56(84) bytes of data.
From 192.168.1.1 icmp_seq=1 Destination Host Unreachable
From 192.168.1.1 icmp_seq=2 Destination Host Unreachable
From 192.168.1.1 icmp_seq=3 Destination Host Unreachable
From 192.168.1.1 icmp_seq=4 Destination Host Unreachable
From 192.168.1.1 icmp_seq=5 Destination Host Unreachable
From 192.168.1.1 icmp_seq=6 Destination Host Unreachable
what should i do? My system is Ubuntu 14.04.

I just change my approach. In this tutorial the second method is not working.
In the first method just don't use the "auto wlan0". (If you do you will connect to another network, possibly)

Related

iwlist p2p0 scan returning "p2p0 Interface doesn't support scanning : Operation not supported"

I am trying to get a list of wireless networks nearby while the adapter is in p2p mode, but iwlist returns the following error:
root#nitrogen6x:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:19:B8:02:50:3A
inet addr:169.254.243.20 Bcast:169.254.255.255 Mask:255.255.0.0
inet6 addr: fe80::219:b8ff:fe02:503a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:8912 errors:0 dropped:0 overruns:0 frame:0
TX packets:203 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:752911 (735.2 KiB) TX bytes:97366 (95.0 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:24689 errors:0 dropped:0 overruns:0 frame:0
TX packets:24689 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1990305 (1.8 MiB) TX bytes:1990305 (1.8 MiB)
p2p0 Link encap:Ethernet HWaddr A4:2B:B0:BC:63:47
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::a62b:b0ff:febc:6347/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:86 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:16155 (15.7 KiB)
root#nitrogen6x:~# iwlist p2p0 scan
p2p0 Interface doesn't support scanning : Operation not supported
root#nitrogen6x:~# iw dev p2p0 scan
command failed: Operation not supported (-95)
root#nitrogen6x:~# iw dev p2p0 scan ap-force
Usage: iw [options] dev scan [-u] [freq ] [ies ] [ssid |passive]
Scan on the given frequencies and probe for the given SSIDs
(or wildcard if not given) unless passive scanning is requested.
If -u is specified print unknown data in the scan results.
Specified (vendor) IEs must be well-formed.
Options:
--debug enable netlink debugging
IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
root#nitrogen6x:~# IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
root#nitrogen6x:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:19:B8:02:50:3A
inet addr:172.16.11.11 Bcast:172.16.11.255 Mask:255.255.255.0
inet6 addr: fe80::219:b8ff:fe02:503a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:9123 errors:0 dropped:0 overruns:0 frame:0
TX packets:222 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:770546 (752.4 KiB) TX bytes:104977 (102.5 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:25329 errors:0 dropped:0 overruns:0 frame:0
TX packets:25329 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2036385 (1.9 MiB) TX bytes:2036385 (1.9 MiB)
wlan0 Link encap:Ethernet HWaddr A4:2B:B0:BC:63:47
inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::a62b:b0ff:febc:6347/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:423 errors:0 dropped:0 overruns:0 frame:0
TX packets:498 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:55955 (54.6 KiB) TX bytes:140014 (136.7 KiB)
root#nitrogen6x:~# iwlist wlan0 scan
wlan0 Interface doesn't support scanning : Operation not supported
root#nitrogen6x:~# iw dev wlan0 scan
command failed: Operation not supported (-95)
root#nitrogen6x:~# iw dev wlan0 scan ap-force
Usage: iw [options] dev scan [-u] [freq ] [ies ] [ssid |passive]
Scan on the given frequencies and probe for the given SSIDs
(or wildcard if not given) unless passive scanning is requested.
If -u is specified print unknown data in the scan results.
Specified (vendor) IEs must be well-formed.
Options:
--debug enable netlink debugging
Please let me know, if there is any other way for scanning wi-fi networks.

VMWare: guest machine internet working randomly

I have an issue with the internet in my VMWare guest machine working very randomly (mostly not working) and I am not sure what the issue might be.
Sometimes the internet works (this also includes possibility to ssh to the host), but most of the time it doesn't.
Restarting networking doesn't help, nor any ifdown/ifup's. The only situation when it might start working is restarting the whole VM. And even then it starts working perhaps one time in 10.
The only potential issue I have noticed so far is that when it doesn't work, VM network adapters' MAC addresses are swapped - while if it works, they are as configured.
Details:
host: OS X El Capitan 10.11.4 running VMWare Fusion 8.0.1
guest: Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1+deb7u2 x86_64 GNU/Linux
VMWare virtual machine network settings:
Network Adapter 1 - NAT - static MAC address 00:50:56:38:CC:21
Network Adapter 2 - Host only - static MAC address 00:50:56:38:CC:22
In my virtual machine .vmx configuration file I have this (related to the interfaces):
ethernet0.present = "TRUE"
ethernet0.connectionType = "nat"
ethernet0.wakeOnPcktRcv = "FALSE"
ethernet0.addressType = "static"
ethernet0.linkStatePropagation.enable = "FALSE"
ethernet0.pciSlotNumber = "33"
ethernet0.address = "00:50:56:38:CC:21"
ethernet0.startConnected = "TRUE"
ethernet0.vnet = "vmnet2"
ethernet0.bsdName = "en0"
ethernet0.displayName = "Wi-Fi"
...
ethernet1.present = "TRUE"
ethernet1.connectionType = "hostonly"
ethernet1.virtualDev = "e1000"
ethernet1.wakeOnPcktRcv = "FALSE"
ethernet1.addressType = "static"
ethernet1.linkStatePropagation.enable = "FALSE"
ethernet1.pciSlotNumber = "37"
ethernet1.address = "00:50:56:38:CC:22"
ethernet1.startConnected = "TRUE"
Host ifconfig:
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=3<RXCSUM,TXCSUM>
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
nd6 options=1<PERFORMNUD>
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether a0:99:9b:0b:bf:c5
inet6 fe80::a299:9bff:fe0b:bfc5%en0 prefixlen 64 scopeid 0x4
inet 10.230.82.42 netmask 0xffffc000 broadcast 10.230.127.255
nd6 options=1<PERFORMNUD>
media: autoselect
status: active
en1: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
options=60<TSO4,TSO6>
ether 6a:00:01:ba:d6:30
media: autoselect <full-duplex>
status: inactive
en2: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
options=60<TSO4,TSO6>
ether 6a:00:01:ba:d6:31
media: autoselect <full-duplex>
status: inactive
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=63<RXCSUM,TXCSUM,TSO4,TSO6>
ether a2:99:9b:b0:3e:00
Configuration:
id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
ipfilter disabled flags 0x2
member: en1 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 5 priority 0 path cost 0
member: en2 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 6 priority 0 path cost 0
nd6 options=1<PERFORMNUD>
media: <unknown type>
status: inactive
p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
ether 02:99:9b:0b:bf:c5
media: autoselect
status: inactive
awdl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1484
ether 7a:81:75:a1:0f:87
inet6 fe80::7881:75ff:fea1:f87%awdl0 prefixlen 64 scopeid 0x9
nd6 options=1<PERFORMNUD>
media: autoselect
status: active
vmnet1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 00:50:56:c0:00:01
inet 192.168.247.1 netmask 0xffffff00 broadcast 192.168.247.255
vmnet8: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 00:50:56:c0:00:08
inet 192.168.195.1 netmask 0xffffff00 broadcast 192.168.195.255
Guest /etc/network/interfaces:
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.195.200
netmask 255.255.255.0
gateway 192.168.195.2
auto eth1
iface eth1 inet static
address 192.168.247.200
netmask 255.255.255.0
Guest ifconfig (when internet works):
eth0 Link encap:Ethernet HWaddr 00:50:56:38:cc:21
inet addr:192.168.195.200 Bcast:192.168.195.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fe38:cc21/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:470 errors:0 dropped:0 overruns:0 frame:0
TX packets:461 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:74106 (72.3 KiB) TX bytes:53650 (52.3 KiB)
Interrupt:19 Base address:0x2000
eth1 Link encap:Ethernet HWaddr 00:50:56:38:cc:22
inet addr:172.16.121.132 Bcast:172.16.121.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fe38:cc22/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1648 (1.6 KiB) TX bytes:578 (578.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:61 errors:0 dropped:0 overruns:0 frame:0
TX packets:61 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:24465 (23.8 KiB) TX bytes:24465 (23.8 KiB)
Guest ifconfig (when internet doesn't work):
eth0 Link encap:Ethernet HWaddr 00:50:56:38:cc:22
inet addr:192.168.195.200 Bcast:192.168.195.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fe38:cc22/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:12 errors:0 dropped:0 overruns:0 frame:0
TX packets:217 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2472 (2.4 KiB) TX bytes:9398 (9.1 KiB)
eth1 Link encap:Ethernet HWaddr 00:50:56:38:cc:21
inet addr:192.168.247.200 Bcast:192.168.247.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:fe38:cc21/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:26 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3498 (3.4 KiB) TX bytes:620 (620.0 B)
Interrupt:19 Base address:0x2000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:219 errors:0 dropped:0 overruns:0 frame:0
TX packets:219 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:42755 (41.7 KiB) TX bytes:42755 (41.7 KiB)
Here I can see the only difference - the MAC addresses are the other way round, compared to how they are configured.
When internet works:
from the guest, pinging all 192.168.195.* works fine (.200, .2 and .1)
from the host, I can ping myself (.1) and the guest (.200), pinging .2 gives me 'Request timeout' error
When it doesn't work:
from the guest I can ping myself (192.168.195.200), but pinging any other 192.168.195.* (.2 or .1) gives me 'Destinaton Host Unreachable' error. Same when pinging the internet (for example 8.8.4.4)
from the host I can ping myself (192.168.195.1), but pinging any other 192.168.195.* (.2 or .200) gives me 'Request timeout' error.
Any idea why this might be happening, and what else I could try?
Thanks!
The issue is solved now.
I tried the workaround described at https://communities.vmware.com/message/2350978#2350978 - generally creating a new VM using the existing VMDK virtual disk (which re-created all the external VM settings) - it worked flawlessly, even though being a little overkill.
Just in case I have kept the copy of the original problematic VM, and then, after getting help from the VMWare employee - which suggested removing the NAT adapter settings (all ethernet0. entries) from the VM's .vmx configuration file, then removing the network adapter itself, and then re-adding it - everything started working perfectly.
Guess I just had some old settings in the .vmx file, from previous versions of VMWare, or old VM configurations...

Get speed of all the ports in Linux

Objective:
Main objective is to the details as below (The JSON part I will do ,getting the below information using command is a problem ,from Java I can run once i get the command )
ether_stat_s
{
port_name [16] : **Name** of the Port(**Can get from ifconfig -a** )
port_udev_id; **ID** of the port ( **No idea from where I can get ID** )
mac_address[32] Mac address (**Ifconfig -a** )
int speed; // 1 = 100 Mbps/ 2 = 1Gbps/ 3 = 10 Gbps(**Only know about wlan0 and eth0**)
uint64_t rx_pkts ( **Ifconfig -a**)
uint64_t tx_pkts (**ifconfig -a**)
};
Work So Far:
I have used the below command to get all the ports
command : ifconfig -a
O/p:
docker0 Link encap:Ethernet HWaddr 39:37:7a:bd:33:99
inet addr:1XX.XX.XX.X Bcast:0.0.0.0 Mask:255.255.0.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
eth0 Link encap:Ethernet HWaddr a0:b3:cc:82:a9:b1
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:64836 errors:0 dropped:0 overruns:0 frame:0
TX packets:64836 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5780566 (5.7 MB) TX bytes:5780566 (5.7 MB)
wlan0 Link encap:Ethernet HWaddr 39:37:7a:bd:33:99
inet addr:1XX.XX.XX.X Bcast:10.0.0.255 Mask:255.255.255.0
inet6 addr: 2601:445:4100:8bf4:76e5:43ff:fe34:c1eb/64 Scope:Global
inet6 addr: fe80::76e5:43ff:fe34:c1eb/64 Scope:Link
inet6 addr: 2601:445:4100:8bf4:2ca2:8b5f:c58e:8fd2/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3204378 errors:0 dropped:0 overruns:0 frame:0
TX packets:2060195 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3719913504 (3.7 GB) TX bytes:583906526 (583.9 MB)
I am able to get Speed of eth0 using ethtool (but it does not give me speed of wlan0 ,docker0,l0) ,I can get speed of wlan0 using iwconfig,but is there any tool such as ethtool which can give me speed of all the ports in my linux .
Also am I going in the right direction on the getting all the port information on linux (ie:Using command ifconfig -a ,or /etc/sbin/network ) .Please can anyone guide me .

Cannot access Puppet Learning VM

I have set up puppet learning VM on VirtualBox. I can ssh into it with:
ssh root#127.0.0.1 -p 2222
However, the guide says to do facter ipaddress, and ssh into the ipaddress that outputs. I get 10.0.2.15.
If I try that ipaddress, it does not work. I want to get it to work.
Also, I am supposed to be able to access the Puppet gui from https://10.0.2.15 and am not able to do that. I think the two problems are related.
I have 3 adapters set up. 1. NAT, 2. host only adapter, 3. bridged network.
For #1, I have port forwarding set up (am not able to ssh without it).
eth0 Link encap:Ethernet HWaddr 08:00:27:44:00:48
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe44:48/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:15892 errors:0 dropped:0 overruns:0 frame:0
TX packets:24276 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1232127 (1.1 MiB) TX bytes:2062554 (1.9 MiB)
eth1 Link encap:Ethernet HWaddr 08:00:27:72:B7:0E
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
eth2 Link encap:Ethernet HWaddr 08:00:27:14:93:EE
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:322880 errors:0 dropped:0 overruns:0 frame:0
TX packets:322880 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:233893154 (223.0 MiB) TX bytes:233893154 (223.0 MiB)
NICs
I don't see any IP assigned to your NICs except eth0. I assume this learning VM is based on centos, please configure your network adapters correctly first.
check:
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/sysconfig/network-scripts/ifcfg-eth1
/etc/sysconfig/network-scripts/ifcfg-eth2
/etc/udev/rules.d/70-persistent-net.rules
This is no puppet or virtualbox issue.
port forwarding
Accessing https://10.0.2.15 will not work, this is an internal NAT network IP. Please create an entry for your VMs NAT Adapter under Port-Forwarding, just map Host Port 10443 to guest port 443. If you try to access https://localhost:10443 in your browser you should reach the service running on this VM and listening on port 443.(Check if the service is running and the firewall/iptables is open on all needed ports).
Patrick is right. The configuration within the CentOS box is strange.
It's working for me under windows but on my Ubuntu system I had big trouble setting up the Training VM.
My Tip: just add 22 and 80 port forwordings in your virtualbox.
Change -> Network -> Adapter 1 -> Port-Forwarding -> add
Protokol: TCP | Host-Port: 2222 | Guest-IP: 10.0.2.15 | Guest-Port: 22
-> you may connect now by:
ssh localhost -p 2222 -l root
also:
Protokol: TCP | Host-Port: 8081 | Guest-IP: 10.0.2.15 | Guest-Port: 80
-> you may access the questguide via:
http://localhost:8081

Ifconfig and IPtables Configuration

Would someone explain this below output of ifconfig command. This PC is using USB IP4 Internet connection.
For example: why there is, inet6 addr: fe80::5a2c:80ff:fe13:9263/64 Scope:Link, assigned /
active on eth1, and why loopback is active.
Am trying to configure IPtables with minimum connections as possible and minimize the risk of intrusion.
I did not find an answer to this question.
With many updates and upgrades to Ubuntu since 12.04.
-------------------------------------------------------------------------------------/
eth0 Link encap:Ethernet HWaddr 00:1e:33:c6:64:94
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
eth1 Link encap:Ethernet HWaddr 58:2c:80:13:92:63
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::5a2c:80ff:fe13:9263/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5291 errors:0 dropped:0 overruns:0 frame:0
TX packets:4188 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4658548 (4.6 MB) TX bytes:458475 (458.4 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:783 errors:0 dropped:0 overruns:0 frame:0
TX packets:783 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:75702 (75.7 KB) TX bytes:75702 (75.7 KB)
-------------------------------------------------------------------------------/
This commend return empty results: nmcli dev list iface eth0 | grep IP4
----------------------------------------------------------------------------/
This commend : nmcli dev list iface eth1 | grep IP4
returns,
IP4.ADDRESS1: ip = 192.168.1.100/24, gw = 192.168.1.1
IP4.DNS1: 192.168.1.1
IP4.DNS[2]: 8.8.8.8
------------------------------------------------------------------------------/
Uname -a: 3.13.0-35-generic #62-Ubuntu SMP Fri Aug 15 01:58:42 UTC 2014 x86_64 x86_64
x86_64 GNU/Linux
In the folder /etc/network you have the interfaces file, in which you can configure your Ethernet configuration. With something like this:
#Configure Loopback
auto lo
iface lo inet loopback
#The primary network interfaces
auto eth0
iface eth0 intet static
address X.X.X.X
netmask 255.255.255.0
gateway X.X.X.255
I hope this can help

Resources