Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Static IP address is not setting broadcast address correctly #1863

Closed
nhi-vanye opened this issue May 18, 2017 · 5 comments
Closed

Static IP address is not setting broadcast address correctly #1863

nhi-vanye opened this issue May 18, 2017 · 5 comments

Comments

@nhi-vanye
Copy link

RancherOS Version: (ros os version) 1.0.1

Where are you running RancherOS? (docker-machine, AWS, GCE, baremetal, etc.)

bare metal - but have reproduced the same issue on VMware VMs

I have multiple NICs, and have configured one for static and one for DHCP - I really don't want the DHCP, but I need something to continue making progress on my project).

After installation my networking looks like

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.100.10.1  netmask 255.0.0.0  broadcast 0.0.0.0
        inet6 fe80::be30:5bff:fed0:ed4d  prefixlen 64  scopeid 0x20<link>
        ether bc:30:5b:d0:ed:4d  txqueuelen 1000  (Ethernet)
        RX packets 883295  bytes 693423318 (693.4 MB)
        RX errors 0  dropped 30704  overruns 0  frame 0
        TX packets 242533  bytes 25254698 (25.2 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.2.229  netmask 255.0.0.0  broadcast 10.255.255.255
        inet6 fe80::be30:5bff:fed0:ed4e  prefixlen 64  scopeid 0x20<link>
        ether bc:30:5b:d0:ed:4e  txqueuelen 1000  (Ethernet)
        RX packets 428537  bytes 31767473 (31.7 MB)
        RX errors 0  dropped 30895  overruns 0  frame 0
        TX packets 99  bytes 7365 (7.3 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Notice the difference in broadcast between the two interfaces - eth0 is static, eth1 is DHCP.

    network:
      interfaces:
        eth0:
          dhcp: false
          address: 10.100.10.1/8
          gateway: 10.0.0.1
        eth1:
          dhcp: true

I can't find anything that would indicate that "broadcast" is a valid keyword... ? It didn't seem to work either way.

@tcely
Copy link

tcely commented Jul 24, 2017

Adding a Broadcast item to https://github.com/rancher/os/blob/master/netconf/netconf_linux.go#L280 shouldn't be overly difficult. A start to this is at:
https://github.com/tcely/os/commit/673bfd5f9cf7c346e89293e53f60fd305385326e

I'd rather netlink just do this for us though so I added a PR for that: vishvananda/netlink#248

@tcely
Copy link

tcely commented Jul 24, 2017

I was able to work around this issue for my case with pre_up.

rancher:
  network:
    interfaces:
      eth0:
        address: 192.168.0.220/24
        dhcp: false
        gateway: 192.168.0.1
        pre_up:
        - ip addr del 192.168.0.220/24 dev eth0
        - ip addr add 192.168.0.220/24 dev eth0 broadcast +

Now my docker images can receive proper broadcast messages (e.g. NTP, DHCP) across reboots without my intervention.

@SvenDowideit
Copy link
Contributor

awesome! when the PR gets merged, I'll have to pull it in

@SvenDowideit SvenDowideit added this to the v1.0.4 milestone Jul 25, 2017
@SvenDowideit
Copy link
Contributor

@tcely I'm going to defer this to 1.0.5 / 1.1.1

@kingsd041
Copy link
Contributor

Tested with RancherOS version- v1.1.2-rc2
When eth0 is static, I can get the correct broadcast address.

  network:
    interfaces:
      eth0:
        address: 10.0.2.20/24
        dhcp: false
        gateway: 10.0.2.2
# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.2.20  netmask 255.255.255.0  broadcast 10.0.2.255
        ether 08:00:27:72:52:f7  txqueuelen 1000  (Ethernet)
        RX packets 705  bytes 56559 (56.5 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 523  bytes 68250 (68.2 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants