PPPoE in a VM

ertank

Explorer
Joined
Sep 16, 2018
Messages
66
Hello,

I have 3 nics in my TrueNAS system. I was using only one of them so far. Due to frequent problems with my hardware routers, I would like to setup a VM inside TrueNAS and assign two nics to it (one nic is formerly used one, other is directly connected to my modem). Then, I would like to establish PPPoE connection and make that VM a gateway.

I simply did that (assigned two nics to VM etc) but my ppp connection never switched to connected state.

I have read a lot of different posts in the forum but I cannot understand for sure what I am trying to do is possible or not.

Any help is appreciated.

Thanks & Regards,
Ertan
 

ertank

Explorer
Joined
Sep 16, 2018
Messages
66
Just to clarify, I would be also OK to use a jail
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
IMHO PPPoE won't work with a VM bridged via tap to your physical interface - which is what TrueNAS does here. The network interface still belongs to the TrueNAS system.

You could try to use PCIe passthrough.
 
Joined
Nov 4, 2020
Messages
2
I use to have to run PPPOE within a VM (PFSense) and i seem to remember i needed to turn on a tunable for it to work

Variablenet.link.bridge.pfil_onlyip
Value0
TypeSysctl
If you are not using PPPoE you may exclude this. If you are using PPPoE, this is required to prevent the packet filter from blocking anything that’s not IP leaving the bridge.

 

ertank

Explorer
Joined
Sep 16, 2018
Messages
66
Thanks a lot @brettjonesoz1

That did solve my problem very nicely. I can have my VM connect to my modem using PPPoE.
VM can access to the internet without any problem at all.

Now, I am trying to setup a DHCP server inside same VM (on the LAN ethernet for sure). Unfortunately, clients are not able to discover that DNS server and get a leased ip number. I wonder if there is anything that I need to do (like a tunable) on my TrueNAS to have it working.

Moreover, I cannot have my client computers to reach to the internet after having their ip, gateway, dns assigned manually. I wonder if that is what @Patrick M. Hausen tried to explain above.
 

ertank

Explorer
Joined
Sep 16, 2018
Messages
66
Correction. It seems DHCP server need sometime until it settles or clients recognize the change.

Only problem I have now seems to be actually routing the traffic between LAN <-> WAN
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Does your DHCP server hand clients the LAN IP address of the VM as the default gateway?
Did you set gateway_enable="YES" inside the VM (assuming it is FreeBSD) to enable routing?
Did you enable NAT in the VM?
 

ertank

Explorer
Joined
Sep 16, 2018
Messages
66
Problem turned out to be a DNS server problem.
I have another VM in my TrueNAS system. It runs Pi-hole. For a reason Pi-hole could not reach to the internet. It is using same interface as gateway VM server LAN.
Once I switch to using DNS server 1.1.1.1 everything started to work.
 
Joined
Dec 22, 2020
Messages
1
Thanks a lot @brettjonesoz1

That did solve my problem very nicely. I can have my VM connect to my modem using PPPoE.
VM can access to the internet without any problem at all.

Now, I am trying to setup a DHCP server inside same VM (on the LAN ethernet for sure). Unfortunately, clients are not able to discover that DNS server and get a leased ip number. I wonder if there is anything that I need to do (like a tunable) on my TrueNAS to have it working.

Moreover, I cannot have my client computers to reach to the internet after having their ip, gateway, dns assigned manually. I wonder if that is what @Patrick M. Hausen tried to explain above.
Hey,
I'm trying to build the same setup here but also struggle with the pppoe.
How did you pass in the network interface finally? Via pci passthrough or as a simple tap device attached to a bridge?
 
Top