broadcast address not found using cat /etc/hosts in console - cmd

i have been trying to install edX ,one of its command line instruction is
cat /etc/hosts
i am getting the response as
cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 precise64
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
broadcast ip is missing ,why is it so?

You don't typically list a broadcast address in /etc/hosts file. Why would you expect to see it there?
What is 'edX' anyway? Got a url for its README file?
Come to think of it, if you really need the broadcast mask for your host, you're
better off using a variant of ifconfig. Here are some examples:
(Solaris 11.x)
enter code here
$ ipadm show-addrprop -p broadcast e1000g0/v4
ADDROBJ PROPERTY PERM CURRENT PERSISTENT DEFAULT POSSIBLE
e1000g0/v4 broadcast r- 192.168.1.255 -- 192.168.1.255 --
limoncello:jmcp $ ifconfig e1000g0
e1000g0: flags=100001100943<UP,BROADCAST,RUNNING,PROMISC,MULTICAST,ROUTER,IPv4,PHYSRUNNING> mtu 1500 index 2
inet 192.168.1.20 netmask ffffff00 broadcast 192.168.1.255
Alternatively, on linux (Debian Jessie):
jmcp#debiant:~$ /sbin/ifconfig eth0
eth0 Link encap:Ethernet HWaddr 08:00:27:cd:61:7c
inet addr:192.168.1.249 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fecd:617c/64 Scope:Link
inet6 addr: 2001:44b8:2188:f000:a00:27ff:fecd:617c/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:258 errors:0 dropped:0 overruns:0 frame:0
TX packets:208 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:44119 (43.0 KiB) TX bytes:29635 (28.9 KiB)
On the Solaris host, the broadcast addr for the interface I'm interested in is 192.168.1.255; on the Debian vm, it's the same.

Related

Docker on Mac... Can't access anything on local network

Running OSX 10.11.6 (for campatibility reasons with some other software that isn't compatible with anything higher, so upgrading OSX isn't a solution) and the highest version of Docker compatible with 10.11.6, which is 17.12.0-ce-mac55 (23011).
Before I continue, I should say I'm not too knowledgeable when it comes to networks, subnets, netmasks, gateways, etc...
From inside any of my containers, I cannot access any hosts on my local network (apart from the host machine). My network config looks like this on the host:
en4: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 00:50:b6:69:51:f3
inet6 fe80::250:b6ff:fe69:51f3%en4 prefixlen 64 scopeid 0x4
inet 172.25.18.19 netmask 0xfffffe00 broadcast 172.25.19.255
nd6 options=1<PERFORMNUD>
media: autoselect (1000baseT <full-duplex>)
status: active
and like this in a container:
eth0 Link encap:Ethernet HWaddr 02:42:C0:A8:10:04
inet addr:192.168.16.4 Bcast:192.168.31.255 Mask:255.255.240.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:24 errors:0 dropped:0 overruns:0 frame:0
TX packets:30 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1683 (1.6 KiB) TX bytes:2551 (2.4 KiB)
For example, from the host, I can telnet to an HP JetDirect box on 172.25.33.51, but not from any container. Similarly, I can get a response from our Navision server's SOAP server from the host, on 172.20.38.62, but not from any container. Same story with a few other machines on slightly different IPs.
Problem is, I need to write an integration bundle that connects to Navision.
Any ideas how I can get access to hosts on the network?

Configure Multiple Bridge IPs in Vagrant

I have the following Vagrantfile which defines many (multi-machine) VMs:
Vagrant.configure(2) do |config|
for i in 1..3 do
config.vm.define "vm#{i}" do |c|
c.vm.box = "ubuntu/xenial64"
c.vm.network "public_network", ip: "192.168.0.#{i + 100}"
c.vm.network :forwarded_port, guest: 22, host: rand(2000...4000), id: 'ssh'
end
end
end
After performing vagrant up, each VM has the same eth1 interface:
eth1 Link encap:Ethernet HWaddr 08:00:27:43:e7:4f
inet addr:192.168.0.103 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: 2607:b400:26:0:a00:27ff:fe43:e74f/64 Scope:Global
inet6 addr: fe80::a00:27ff:fe43:e74f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:59 errors:0 dropped:0 overruns:0 frame:0
TX packets:38 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:10065 (10.0 KB) TX bytes:3832 (3.8 KB)
I would like each VM to have a separate IP, but each one strangely adopts the IP 192.168.0.103. If I omit the ip specification to public_network, each VM's eth1 IP is different.
How can I configure multiple bridge IPs in a multi-machine Vagrantfile?
I guess its one of ruby caveat (you can read Closures and for loops in Ruby and probably other good resources on the net)
basically replace you for loop
for i in 1..3 do
with equivalent
(1..3).each do |i|

How can I find the host machine network ip address on travis?

Sorry for the naive question but I am new to using travis and read the docs thoroughly but I can't figure out what exactly I need to put in my .travis.yml or use as an IP address.
I have setup my server on local host in travis. For client testing I need the ip address of the local host to test my client app.
Any help is highly appreciated. Thanks :)
This works:
language: generic
addons:
apt:
packages:
- net-tools
script:
- /sbin/ifconfig
That installs the net-tools package, then calls the ifconfig command that package adds.
In the output from that command, you want to look at the information for the eth0 interface:
eth0 Link encap:Ethernet HWaddr 02:42:ac:11:00:08
inet addr:172.17.0.8 Bcast:0.0.0.0 Mask:255.255.0.0
inet6 addr: fe80::42:acff:fe11:8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1245 errors:0 dropped:0 overruns:0 frame:0
TX packets:1083 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:17000256 (17.0 MB) TX bytes:122513 (122.5 KB)
But it’s better these days to instead use the ip command from the iproute2 package:
dist: trusty
language: generic
addons:
apt:
packages:
- iproute2
script:
- ip a
Sample output:
10: eth0#if11: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:ac:11:00:05 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.5/16 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::42:acff:fe11:5/64 scope link
valid_lft forever preferred_lft forever

3 IP address from RPI3 eth + wlan +?

I have a raspberry 3 connected by ethernet and wifi to my router.
So I understand I should have 2 IP address referring to it.
But I wrote hostname -I and get 3 different IP addresses:
192.168.1.100, 192.168.1.33 and 192.168.1.35
Where does the third IP come from?
if I disconnect the ethernet cable from the RPI and write again hostname -I I get:
192.168.1.100 and 192.168.1.33
this does not make sense with 'ifconfig' result:
eth0 Link encap:Ethernet HWaddr b8:27:eb:d6:xx:xx
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::ba27:ebff:fed6:xxxx/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:23152 errors:0 dropped:6 overruns:0 frame:0
TX packets:51977 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:12371346 (11.7 MiB) TX bytes:58608891 (55.8 MiB)
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:416 errors:0 dropped:0 overruns:0 frame:0
TX packets:416 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:47205 (46.0 KiB) TX bytes:47205 (46.0 KiB)
wlan0 Link encap:Ethernet HWaddr b8:27:eb:83:xx:xx
inet addr:192.168.1.33 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::8df4:f4d0:xxxx:115/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:28407 errors:0 dropped:23070 overruns:0 frame:0
TX packets:4040 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7492811 (7.1 MiB) TX bytes:4725779 (4.5 MiB)
update:
As Bugfinger pointed out the use of ip addr show shows which device the address is assigned to:
2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:d6:fb:5a brd ff:ff:ff:ff:ff:ff
inet 192.168.1.100/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
inet 192.168.1.35/24 brd 192.168.1.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet6 fe80::ba27:ebff:fed6:fb5a/64 scope link
valid_lft forever preferred_lft forever`
I have 2 different addresses to eth0:
scope global eth0 and scope global secondary eth0
Recent Raspbian versions (since Jessie) are using DHCP Client Daemon (DHCPCD) to configure network devices. So static IP addresses are to be configured in /etc/dhcpcd.conf. If you configured them to be static manually or via /etc/network/interfaces, you end up with one static and one dynamic IP address on the same device. As far as I read about it, it's not clear yet, if that's a bug in DHCPCD or an expected behaviour after mis-configuration.
Anyway, to change that, you have to do as follows.
To see if it is running, check the output of:
sudo service dhcpcd status
If it is not running, start it with:
sudo service dhcpcd start
sudo systemctl enable dhcpcd
If you did already changed /etc/network/interfaces, you need to revert those changes. The original contents of that file (in Jessie) is:
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
iface eth0 inet manual
allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Now all interfaces should be configured through DHCP again. If you now want to set a static IP address for eth0, edit /etc/dhcpcd.conf and put in:
interface eth0
static ip_address=192.168.1.100/24
static routers=192.168.1.1 # or whatever your router is
static domain_name_servers=192.168.1.1 # same as router
After saving the file and sudo reboot, your Raspi should reboot with a static eth0 and a dynamic wlan0 and without the extra IP address hanging around.

Multiple static addresses on same interface via Vagrant

So in trying to convert manual installation instructions to Vagrant on setting up the VM, I'm stumped on how I make the /etc/network/interfaces file have the following:
auto eth1
iface eth1 inet static
address 192.168.56.101
netmask 255.255.255.0
auto eth1:1
iface eth1:1 inet static
address 192.168.56.102
netmask 255.255.255.0
auto eth1:2
iface eth1:2 inet static
address 192.168.56.103
netmask 255.255.255.0
These interfaces are all using a host-only adapter on the VM in VirtualBox.
I know I can just create three separate adapters and use the same host-only adapter doing something like this:
config.vm.network "private_network", ip: "192.168.56.101"
config.vm.network "private_network", ip: "192.168.56.102"
config.vm.network "private_network", ip: "192.168.56.103"
But that doesn't obviously match the above file. I'd rather not have some hacky solution of rewriting /etc/network/interfaces on boot-up/shutdown, but I can't seem to get Vagrant to work and can't find anything else on it beyond very simple tutorials.
I am not sure you can do that just using default network config.
I tried a few options using some parameters as
config.vm.network "private_network", ip: "192.168.50.101", :device => "eth1", :adapter => 1, :netmask => "255.255.255.0"
config.vm.network "private_network", ip: "192.168.50.102", :device => "eth1:1", :adapter => 1, :netmask => "255.255.255.0"
config.vm.network "private_network", ip: "192.168.50.103", :device => "eth1:2", :adapter => 1, :netmask => "255.255.255.0"
but this will either VM will not boot or each interface has its own interface.
Then looking at https://docs.vagrantup.com/v2/networking/public_network.html / DISABLE AUTO-CONFIGURATION, you can do the following
# manual ip
config.vm.network "public_network", auto_config: false
config.vm.provision "shell",
run: "always",
inline: "ifconfig eth1 192.168.50.101 netmask 255.255.255.0 up"
config.vm.provision "shell",
run: "always",
inline: "ifconfig eth1:1 192.168.50.102 netmask 255.255.255.0 up"
config.vm.provision "shell",
run: "always",
inline: "ifconfig eth1:2 192.168.50.103 netmask 255.255.255.0 up"
when running ifconfig -a on the VM you get
eth0 Link encap:Ethernet HWaddr 00:0c:29:e5:fe:e1
inet addr:172.16.42.238 Bcast:172.16.42.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fee5:fee1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:766 errors:0 dropped:0 overruns:0 frame:0
TX packets:489 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:83256 (83.2 KB) TX bytes:69904 (69.9 KB)
eth1 Link encap:Ethernet HWaddr 00:0c:29:e5:fe:eb
inet addr:192.168.50.101 Bcast:192.168.50.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fee5:feeb/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:125 errors:0 dropped:20 overruns:0 frame:0
TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:10180 (10.1 KB) TX bytes:1478 (1.4 KB)
eth1:1 Link encap:Ethernet HWaddr 00:0c:29:e5:fe:eb
inet addr:192.168.50.102 Bcast:192.168.50.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth1:2 Link encap:Ethernet HWaddr 00:0c:29:e5:fe:eb
inet addr:192.168.50.103 Bcast:192.168.50.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Resources