Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Need to create virtual NIC in Ubuntu 18.04 as with Windows 10 have

    Scheduled Pinned Locked Moved Virtualization
    5 Posts 3 Posters 1.5k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • O Offline
      oscar77
      last edited by

      Hi all.

      I am looking for a "loopback interface" as in my windows partition have, i have a pfsense wmware virtualized, the loopback interface gets an ip address from the virtualized pfsense and i can route all trafic to pfsense.

      I have the same scenario in Ubuntu 18.04, since netplan and network manager is managing my wifi and real nic adapter, how i can install a "virtual loopback interface" or "virtual nic" for get an ip address from my virtualized pfsense machine?

      Thanks all!

      1 Reply Last reply Reply Quote 0
      • O Offline
        oscar77
        last edited by

        I have set a dummy interface:

        ip li add dummy0 type dummy

        Then i have bridged vmware vmnet2 to dummy0, now when i do "dhclient dummy0" i receive IP from pfsense.

        But when i ping to pfsense firewall all packets are loss 100 %

        why?

        G 1 Reply Last reply Reply Quote 0
        • KOMK Offline
          KOM
          last edited by

          These are Linux and VMware questions that have nothing to do with pfSense specifically. Maybe a VMware forum would be more useful to you.

          1 Reply Last reply Reply Quote 0
          • G Offline
            gjaltemba @oscar77
            last edited by

            @oscar77 said in Need to create virtual NIC in Ubuntu 18.04 as with Windows 10 have:

            But when i ping to pfsense firewall all packets are loss 100 %
            why?

            Did you try to ping ubuntu from pfsense?
            What is the output in ubuntu of
            ip route

            O 1 Reply Last reply Reply Quote 0
            • O Offline
              oscar77 @gjaltemba
              last edited by

              @gjaltemba thx for your response.

              I finally solve it, i'm using this script:

              #!/bin/bash

              Setup network namespace with veth pair, start xterm in it

              nsterm ns0 veth0 10.0.0 yellow 24

              if [[ $EUID -ne 0 ]]; then
              echo "This script must be run as root" 1>&2
              exit 1
              fi

              NS=${1:-ns0}
              DEV=${2:-veth0}
              DEV_A=${DEV}a
              DEV_B=${DEV}b
              ADDR=${3-:10.0.0}
              ADDR_A=${ADDR}.254
              ADDR_B=${ADDR}.1
              MASK=${5:-24}
              COL=${4:-yellow}

              echo ns=$NS dev=$DEV col=$COL mask=$MASK

              ip netns add $NS
              ip link add $DEV_A type veth peer name $DEV_B netns $NS
              ip addr add $ADDR_A/$MASK dev $DEV_A
              ip link set ${DEV}a up
              ip netns exec $NS ip addr add $ADDR_B/$MASK dev $DEV_B
              ip netns exec $NS ip link set ${DEV}b up
              ip netns exec $NS ip route add default via $ADDR_A dev $DEV_B
              ip netns exec $NS su -c "xterm -bg $COL &" USER

              When i do "dhclient veth0a" i receive ip address from pfsense, and i can finally route all traffic throught pfsense

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.