0

I'm trying to set a static IP on two interfaces (ens160 "Main") and (ens192 "I added later"). I tried setting up configuration files for netplan (/etc/netplan/01-network-card.yaml) and for (/etc/cloud/cloud.cfg.d/50-curtin-networking.cfg) each at a time then both. Noting that all 3 are VMs on a Vmware ESXI 6.7 Hypervisor.

The main issue is with the ens192 interface can ping itself (ping -I ens192 192.168.20.41) but it's not able to reach other IPs (not even 192.168.20.241 which is on the same machine).

any help is much appreciated since I've been stuck with this problem for days and I need to set up 2 other nodes (lab environment) to proceed with my Kubernetes course.

$ip a (results)

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: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0c:29:ee:9e:fb brd ff:ff:ff:ff:ff:ff
    inet 192.168.20.241/22 brd 192.168.23.255 scope global ens160
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:feee:9efb/64 scope link 
       valid_lft forever preferred_lft forever
3: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0c:29:ee:9e:05 brd ff:ff:ff:ff:ff:ff
    inet 192.168.20.41/22 brd 192.168.23.255 scope global ens192
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:feee:9e05/64 scope link 
       valid_lft forever preferred_lft forever
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:8b:5d:b5:35 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
5: flannel.1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN group default 
    link/ether 76:01:b0:4a:cf:0f brd ff:ff:ff:ff:ff:ff
    inet 10.1.98.0/32 scope global flannel.1
       valid_lft forever preferred_lft forever
    inet6 fe80::7401:b0ff:fe4a:cf0f/64 scope link 
       valid_lft forever preferred_lft forever

/etc/netplan/01-network-card.yaml

network:
ethernets:
    ens160:
        addresses:
        - 192.168.20.241/22
        gateway4: 192.168.20.1
        nameservers:
            addresses:
            - 192.168.20.1

    ens192:
        addresses:
        - 192.168.20.41/22
        gateway4: 192.168.20.1
        nameservers:
            addresses:
            - 192.168.20.1
version: 2

/etc/cloud/cloud.cfg.d/50-curtin-networking.cfg

network:


ethernets:
    ens160:
      addresses:
      - 192.168.20.241/22
      gateway4: 192.168.20.1
      nameservers:
        addresses:
        - 192.168.20.1
    ens160:
      addresses:
      - 192.168.20.41/22
      gateway4: 192.168.20.1
      nameservers:
        addresses:
        - 192.168.20.1
  version: 2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.