Score:0

Netplan route code to support secondary network

dk flag

Clean install of 22.04 server with all available updates applied. Network: Router (10.1.1.254)-->Server (10.1.1.1)-->second NIC(192.168.49.1)--> Desktop (Windows 10). Windows 11 Desktop on 10.1.1.0 network has access to Internet. Windows 10 on 192.168.49.0 network doesn't. Can ping to/from server/Windows 10. Normally research and find answers myself, but this one has me stumped.

YAML code:

  version: 2
  ethernets:
    enp0s31f6:
      routes:
        - to: default
          via: 10.1.1.254
      nameservers:
        addresses: [10.1.1.254]
      dhcp4: false
      dhcp6: false
      addresses: [10.1.1.1/24]
    enp5s0:
      routing-policy:
        - from: 192.168.49.0/24
          to: 10.1.1.254
      dhcp4: false
      dhcp6: false
      addresses: [192.168.49.1/24]
      optional: true

Routing-policy on secondary NIC, just a guess; doesn't work. Thanks in anticipation.

First of all, thanks you for your response. This was actually an update of an existing server(pre Netplan version) - a second attempt after a long hiatus. I prefer clean installs, but retain all customisations to alter the new install. Hence my reason for focusing on Netplan as the suspect i.e. not a lot of knowledge of networking or Netplan. Your response forced me to review my Nat changes(transcription errors?) - they looked OK. I deleted the routing-policy statements and went through a restart/ping process. To my suprise I could ping the Windows 11 PC on the other network from my Windows 10 PC and vice versa. So started a browser session and found I could access the Internet from the Windows 10 PC on the secondary network.Not convinced it was the Netplan change that made the difference, but have no other explanation.

Score:0
us flag

It looks like you are trying to set up your Ubuntu system as a NATing router for the 192.168.49.0 network. netplan does not set up NAT. You will need to use iptables/nftables, or a package that provides a frontend to these tools, to configure NAT rules.

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.