Beaglebone black eth0 does not get static ip configuration - networking

I have an interface eth0 which I add to bridge (br-lan).
Then I want to give eth0's IP to br-lan and bring eth0 to state with no IP for it.
I did following steps but after some interval eth0 gets another DHCP IP different from br-lan but within same subnet.
# brctl addbr br-lan
# brctl addif br-lan eth0
# ifconfig br-lan up
# ifconfig
br-lan Link encap:Ethernet HWaddr d0:39:72:54:c5:93
inet6 addr: fe80::d239:72ff:fe54:c593/64 Scope:Link
inet6 addr: fd00:aaaa::d239:72ff:fe54:c593/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:545 errors:0 dropped:0 overruns:0 frame:0
TX packets:36 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:44350 (43.3 KiB) TX bytes:6125 (5.9 KiB)
eth0 Link encap:Ethernet HWaddr d0:39:72:54:c5:93
inet addr:192.168.11.175 Bcast:192.168.11.255 Mask:255.255.255.0
inet6 addr: fe80::d239:72ff:fe54:c593/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:27 errors:0 dropped:0 overruns:0 frame:0
TX packets:306 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5145 (5.0 KiB) TX bytes:37372 (36.4 KiB)
Interrupt:40
root#beaglebone:~# ifconfig eth0 0.0.0.0
root#beaglebone:~# ifconfig
br-lan Link encap:Ethernet HWaddr d0:39:72:54:c5:93
inet6 addr: fe80::d239:72ff:fe54:c593/64 Scope:Link
inet6 addr: fd00:aaaa::d239:72ff:fe54:c593/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:545 errors:0 dropped:0 overruns:0 frame:0
TX packets:36 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:44350 (43.3 KiB) TX bytes:6125 (5.9 KiB)
eth0 Link encap:Ethernet HWaddr d0:39:72:54:c5:93
inet6 addr: fe80::d239:72ff:fe54:c593/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:35 errors:0 dropped:0 overruns:0 frame:0
TX packets:313 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6048 (5.9 KiB) TX bytes:37792 (36.9 KiB)
Interrupt:40
root#beaglebone:~# dhclient br-lan
root#beaglebone:~# ifconfig
br-lan Link encap:Ethernet HWaddr d0:39:72:54:c5:93
inet addr: 192.168.11.192 Bcast:192.168.11.255 Mask:255.255.255.0
inet6 addr: fe80::d239:72ff:fe54:c593/64 Scope:Link
inet6 addr: fd00:aaaa::d239:72ff:fe54:c593/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:548 errors:0 dropped:0 overruns:0 frame:0
TX packets:45 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:45134 (44.0 KiB) TX bytes:9094 (8.8 KiB)
eth0 Link encap:Ethernet HWaddr d0:39:72:54:c5:93
inet addr:192.168.11.175 Bcast:192.168.11.255 Mask:255.255.255.0
inet6 addr: fe80::d239:72ff:fe54:c593/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:499 errors:0 dropped:0 overruns:0 frame:0
TX packets:794 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:42497 (41.5 KiB) TX bytes:74010 (72.2 KiB)
Interrupt:40
Does anyone have any idea why eth0 gets back different IP?
My /etc/network/interfaces have no configuration for eth0 DHCP. Infact even if I add following lines to it, eth0 still gets 192.168.11.X IP after I do "dhclient br-lan"
auto eth0
iface eth0 inet static
address 192.168.0.102
netmask 255.255.255.0
network 192.168.0.0
gateway 192.168.0.1
How do I ask eth0 to net get DHCP IP and just stick to no-IP
I am running Debian 7.4 on Beaglebone

Apparently wicd was reconnecting eth0. Following steps fixed the problem of auto- reconnecting eth0
Change the "auto_reconnect = True" to "auto_reconnect = False" in /etc/wicd/manager-settings.conf
/etc/init.d/wicd restart

Related

how to grep and redirect the mac address alone without its prefix & suffix to a file for ifconfig command?

i have pasted the output of ifconfig command, and wanted to redirect the mac address(00:e0:4c:68:00:26) to a file from the entire output.
eth0 Link encap:Ethernet HWaddr 00:e0:4c:68:00:26
inet addr:192.168.10.1 Bcast:192.168.10.255 Mask:255.255.255.0
inet6 addr: fe80::2e0:4cff:fe68:26/64 Scope: Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:671 errors:0 dropped:0 overruns:0 frame:0
TX packets:4546 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:70055 TX bytes:1595889
Try this:
I've stored the output of ifconfig in a variable a:
mayankp#mayank:~/$ echo $a
eth0 Link encap:Ethernet HWaddr 00:e0:4c:68:00:26
inet addr:192.168.10.1 Bcast:192.168.10.255 Mask:255.255.255.0
inet6 addr: fe80::2e0:4cff:fe68:26/64 Scope: Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:671 errors:0 dropped:0 overruns:0 frame:0
TX packets:4546 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:70055 TX bytes:1595889
mayankp#mayank:~/$ echo $a| awk -F" " '{print $5}'|head -1 > 'mac_addr.txt'
mayankp#mayank:~/$ cat mac_addr.txt
00:e0:4c:68:00:26
Let me know if it works.

What's eth0 used for in docker host machine

I'm using Docker on Windows. When I ssh to a docker host machine(local VM) and type ifconfig, normally we get something like this:
docker#master:~$ ifconfig
docker0 Link encap:Ethernet HWaddr 02:42:82:A3:2D:FB
inet addr:172.17.0.1 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 08:00:27:E8:A3:F6
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fee8:a3f6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:243 errors:0 dropped:0 overruns:0 frame:0
TX packets:235 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:39044 (38.1 KiB) TX bytes:39544 (38.6 KiB)
eth1 Link encap:Ethernet HWaddr 08:00:27:83:CF:41
inet addr:192.168.99.101 Bcast:192.168.99.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe83:cf41/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:297 errors:0 dropped:0 overruns:0 frame:0
TX packets:227 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:29987 (29.2 KiB) TX bytes:32525 (31.7 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:32 errors:0 dropped:0 overruns:0 frame:0
TX packets:32 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:2752 (2.6 KiB) TX bytes:2752 (2.6 KiB)
I know that docker0 is the bridge network created by Docker, eth1 is the interface connects to the outer world, lo is the loopback interface, my question is what's eth0 here used for?
I think I got the point. When I come to the VirtualBox Network Settings, I found there're 2 network cards, and the first one using NAT with port forwarding.
Name:ssh | Host Port:53289 | Guest Port:22
So I thought the eth0 is used for ssh connection by docker client. That's why there's no such an interface in a normal Linux OS(rather than this Boot2Docker local VM).
Different ideas are welcome!

centos 6.7 - no connection- unknown host

I'm new to centos.
When I'm at work I'm able to connect to my centos server from my mac, Now I'm trying to connect from home and I can't.
I've tried pinging google.com and recieved: unknown host google.com .
Maybe it's something with the ip I get from my home router?
here's my /etc/hosts file:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
Here's my ifconfig:
eth0 Link encap:Ethernet HWaddr 00:1C:42:B3:AC:2C
inet6 addr: fe80::21c:42ff:feb3:ac2c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:730172 errors:0 dropped:0 overruns:0 frame:0
TX packets:582258 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:642394306 (612.6 MiB) TX bytes:59636955 (56.8 MiB)
eth1 Link encap:Ethernet HWaddr 00:1C:42:19:FB:DC
inet addr:10.37.129.3 Bcast:10.37.129.255 Mask:255.255.255.0
inet6 addr: fdb2:2c26:f4e4:1:21c:42ff:fe19:fbdc/64 Scope:Global
inet6 addr: fe80::21c:42ff:fe19:fbdc/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:694184 errors:0 dropped:0 overruns:0 frame:0
TX packets:465777 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:104085044 (99.2 MiB) TX bytes:1662635867 (1.5 GiB)
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:3581071 errors:0 dropped:0 overruns:0 frame:0
TX packets:3581071 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3060357993 (2.8 GiB) TX bytes:3060357993 (2.8 GiB)
P.S-
I'm not sure if it matters, but I'm using Nginx server. I can't restart it also.
Please checks your Centos server file
/etc/hosts.allow
It maybe only allowing certain IPs access to the Centos Box
Your work IP maybe in there but your home IP may not

Vagrant Host Unreachable - Possible Conflict

I have multiple Vagrant 1.7.4 boxes running on VirtualBox 5, but I believe I am running into conflicts with my network setup. I can always "vagrant ssh" to a box when it comes online, but it's hit or miss if I can access the webserver. Rebooting my machine or starting the boxes in a different order can correct the problem. I am running OSX El Capitan. Here is the relevant setup:
Machine 1 (can't access webserver from OSX):
config.vm.network "private_network", ip: "10.10.10.10"
eth0 Link encap:Ethernet HWaddr 08:00:27:6B:1C:DD
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe6b:1cdd/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:775 errors:0 dropped:0 overruns:0 frame:0
TX packets:572 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:80340 (78.4 KiB) TX bytes:70508 (68.8 KiB)
eth1 Link encap:Ethernet HWaddr 08:00:27:3E:44:A3
inet addr:10.10.10.10 Bcast:10.10.10.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe3e:44a3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:1128 (1.1 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: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)
Machine 2 (working fine):
config.vm.network "private_network", ip: "10.11.11.11"
eth0 Link encap:Ethernet HWaddr 08:00:27:6B:1C:DD
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe6b:1cdd/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10773 errors:0 dropped:0 overruns:0 frame:0
TX packets:6361 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7430638 (7.0 MiB) TX bytes:482303 (470.9 KiB)
eth1 Link encap:Ethernet HWaddr 08:00:27:73:39:23
inet addr:10.11.11.11 Bcast:10.11.11.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe73:3923/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5646 errors:0 dropped:0 overruns:0 frame:0
TX packets:6693 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:625645 (610.9 KiB) TX bytes:6934485 (6.6 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:1270 errors:0 dropped:0 overruns:0 frame:0
TX packets:1270 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1144652 (1.0 MiB) TX bytes:1144652 (1.0 MiB)

Capturing on a non-default interface with tcpdump

O/P of if config is
[root#test2 ~]# 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:16436 Metric:1
RX packets:3045306 errors:0 dropped:0 overruns:0 frame:0
TX packets:3045306 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:969363066 (924.4 MiB) TX bytes:969363066 (924.4 MiB)
p4p1 Link encap:Ethernet HWaddr F0:4D:A2:F7:CE:20
inet addr:192.168.250.58 Bcast:192.168.250.255 Mask:255.255.255.0
inet6 addr: fe80::f24d:a2ff:fef7:ce20/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:222163621 errors:0 dropped:0 overruns:0 frame:0
TX packets:29525032 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:67504475609 (62.8 GiB) TX bytes:13910424527 (12.9 GiB)
virbr0 Link encap:Ethernet HWaddr 52:54:00:3C:38:60
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
UP BROADCAST RUNNING 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)
when i executed tcpdump , o/p is
root#test2 ~]# tcpdump
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on virbr0, link-type EN10MB (Ethernet), capture size 65535 bytes
where it is listening to vibra0 interface as default.
I want to set p4p1 interface as default interface so that i may get appropriate o/p when executing tcpdump.
Any solutions.
You cannot change tcpdump's default interface (unless you hack either tcpdump or libpcap's code).
You can, however, tell tcpdump to capture on a particular interface by using the -i option:
tcpdump -i p4p1

Resources