# Defining node ip address

**URL:** <https://discuss.kubernetes.io/t/defining-node-ip-address/24339>\
**Category:** General Discussions\
**Tags:** network\
**Created:** [May 25, 2023, 9:56pm UTC](https://discuss.kubernetes.io/t/defining-node-ip-address/24339 "2023-05-25T21:56:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lev-stas](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/lev-stas/32/12613_2.png) [@lev-stas](https://discuss.kubernetes.io/u/lev-stas)\
**Post date:** [May 25, 2023, 9:56pm UTC](https://discuss.kubernetes.io/t/defining-node-ip-address/24339/1 "2023-05-25T21:56:19Z")

</div>

Hi there. As far as support request issue link from github leads here, I’ll post my question in a topic. And will appreciate if someone is able to help.  
I have a two node cluster. Each node has two network interfaces - eth0 with public IP assigned and eth1 with private IP. After cluster initialization all nodes has their public addresses as INTERNAL-IP

```auto
$ k get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
do-k8s-01 Ready control-plane 3h15m v1.26.2 209.XX.XX.XX <none> Debian GNU/Linux 11 (bullseye) 5.10.0-23-amd64 containerd://1.7.1
do-k8s-02 Ready <none> 98m v1.26.2 68.XX.XX.XX <none> Debian GNU/Linux 11 (bullseye) 5.10.0-23-amd64 containerd://1.7.1

```

Cluster is deployed via kubeadm tool. I would like to use private ip adress assigned to eth1 interace as nodeIP, but can’t set it.  
I have read in documentation about `--node-ip` parameter for kubelet. But seams it doesn’t work. I have tried to add `nodeIP: 10.14.0.2` to my kubelet yaml config file, but after its restart nodeIP hasn’t been changed. I have also tried to add `--node-ip=10.14.0.2` to kubelet.service file, but also with no luck.  
I would be appreciate if someone can show me a sample of kubelet config where node address will be defined properly.

### Cluster information:

Kubernetes version: 1.26  
Cloud being used: self managed cluster on Digital Ocean  
Installation method: kubeadm  
Host OS: debian 11  
CNI and version: cni-plugins-linux-amd64-v1.3.0  
CRI and version: containerd://1.7.1

You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.

---

<div class="post-metadata">

**Author:** ![qdii](https://avatars.discourse-cdn.com/v4/letter/q/7bcc69/32.png) [@qdii](https://discuss.kubernetes.io/u/qdii)\
**Post date:** [October 2, 2023, 9:28pm UTC](https://discuss.kubernetes.io/t/defining-node-ip-address/24339/2 "2023-10-02T21:28:48Z")

</div>

What worked for me were the following steps. Let’s say we want to assign IP address 192.168.2.10 to the node [foo.bar.com](http://foo.bar.com):

1. Edit `/etc/hosts` and add “192.168.2.10 [foo.bar.com](http://foo.bar.com)”
2. Edit `/var/lib/kubelet/kubeadm-flags.env` and add “–node-ip=192.168.2.10”
3. (re) join the cluster
