umiddelb / z2d

Zero 2 Docker with Ubuntu Core, Debian 9, Devuan, Fedora 28 or CentOS 7
144 stars 37 forks source link

DHCP to static ip address doesn't work #18

Open gdeverlant1 opened 7 years ago

gdeverlant1 commented 7 years ago

Moved the issue from other thread to this separate ticket.

I changed also the DHCP Ip address at \etc\network\interfaces.d\eth0 by the following:

auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.1.14
netmask 255.255.255.0   
gateway 192.168.1.1

and rebooted and it seems not to work anymore. Can't access the node via SSH.

gdeverlant1 commented 7 years ago

@umiddelb In my observation when I do ip a in shell I get this output :

debian@bambuserver12:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether ea:42:6e:cd:4f:87 brd ff:ff:ff:ff:ff:ff
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 1e:51:6a:6d:c6:a0 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.34/24 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::1c51:6aff:fe6d:c6a0/64 scope link
       valid_lft forever preferred_lft forever
4: docker_gwbridge: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
    link/ether 02:42:e4:b6:c1:ca brd ff:ff:ff:ff:ff:ff
    inet 172.18.0.1/16 scope global docker_gwbridge
       valid_lft forever preferred_lft forever
5: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
    link/ether 02:42:29:4c:d9:ea brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 scope global docker0
       valid_lft forever preferred_lft forever

This part is weird I never saw this before in IP on Debian:

inet 192.168.1.34/24 brd 192.168.1.255 scope global eth0

Does it mean that my setting should look like ?:

auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.1.14/24
netmask 255.255.255.0/24
broadcast 192.168.1.255
gateway 192.168.1.1/24

I'Ve found this link with the new replacement of ifconfig by ip :

https://www.tecmint.com/ip-command-examples/ https://www.cyberciti.biz/faq/linux-ip-command-examples-usage-syntax/

Finally I've decided to set the IP of the node on my Router statically for the moment it bypass this problem.