Score:0

Netplan - two interfaces internet/intranet

za flag

I have server with two NIC. One is for intranet (ens160) and second is for access to internet (ens192). I tried to set this configuration through netplan and tried several combinations, unfortunately I have a problem with incoming connection from intranet e.g. I am not able to connect by ssh to the server.

This is my netplan configuration

network:
  ethernets:
    ens160:
      addresses:
      - 10.133.30.61/24
      nameservers:
        addresses:
        - 10.133.24.222
        search: []
      routes:
      - to: 10.133.30.0/24
        via: 10.133.30.1
    ens192:
      dhcp4: true
  version: 2

Internet works, I can ping another servers in intranet, but as I said, I am not able to connect to this server.

ip route

ip addr

However if I change netplan configuration to this, ping/ssh works, but internet doesn't

network:
  ethernets:
    ens160:
      addresses:
      - 10.133.30.61/24
      nameservers:
        addresses:
        - 10.133.24.222
        search: []
      routes:
      - to: default
        via: 10.133.30.1
    ens192:
      dhcp4: true
  version: 2

Could someone help me, how to solve this problem?

eKKiM avatar
lr flag
1. You shouldn't route traffic in the same subnet. 2. Do you have firewall enabled? If so, what firewall rules are active?
rumcajs avatar
za flag
No, I don't have firewall. If I change `routes: -to: default` instead of `- to 10.133.30.0/24` I can ping server, but internet doesn't work.
eKKiM avatar
lr flag
You shouldn't need any route (not even the default) on ens160 (if your intranet is all on the same subnet).
rumcajs avatar
za flag
@eKKiM I deleted routes from ens160, same problem. Internet/intranet works, but incoming traffic not :/
eKKiM avatar
lr flag
Can you clarify where the incoming traffic is coming from? Did you only check SSH? Ping? ... and whats the IP of the host you are testing from?
rumcajs avatar
za flag
I am idiot... I didn't realize that I am connected through VPN and I have another IP. Instead IP from range 10.133.30.0, PC on VPN has 192.168.0.0. Thank you for your reply, it helps me to find out problem :D
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.