How to configure a jail to only use IPv4

byrnejb

Active Member


Messages: 109

I have a problem with a jail trying to update and install gems from rubygem.org. Apparently this is some problem with IPv6. The Gem utility is reported to prefe IPv6 if it is available. I would like to configure the jail to only use ipv4 and avoid this if this turns out to be the problem. The jail is configured only with an IPv4 address. The Host has IPv6 enabled. I have looked at ail(8) and rc.conf(5) but cannot find a switch or parameter that turns ipv6 off. How does one turn off ipv6 in a jail without impacting the host?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,771
Messages: 30,912

I would like to configure the jail to only use ipv4 and avoid this if this turns out to be the problem.
It's not.

How does one turn off ipv6 in a jail without impacting the host?
Don't configure it.

I suspect your analysis is wrong and there's something else not configured correctly. What are the exact error messages you're getting?

Case in point:
Code:
root@molly:~ # jls
   JID  IP Address      Hostname                      Path
     1  192.168.10.202  j-ports.dicelan.home          /jails/j-ports
The host uses both IPv6 and IPv4, this jail only uses IPv4.
 
OP
OP
B

byrnejb

Active Member


Messages: 109

Well, the fix was to add all of the ipv4 addresses for rubygem.org into the jail's /etc/hosts file.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,771
Messages: 30,912

That might indicate that you have an issue with /etc/resolv.conf in the jail. Did you copy it from the host? The host might be configured to use IPv6 DNS addresses, which won't work inside an IPv4 only jail.
 
OP
OP
B

byrnejb

Active Member


Messages: 109

There was no problem with resolv.conf. The issue is some incompatibility with ipv6 at RubyGem.org. The issue has been widely reported. I just was not current.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,771
Messages: 30,912

The issue is some incompatibility with ipv6 at RubyGem.org.
But you're not using IPv6? Not on your jail at least. So why would it have a problem?
 
OP
OP
B

byrnejb

Active Member


Messages: 109

Good question. I do not have an answer. Not everybody using ipv6 encounters it. Some people have solved this issue for themselves by disabling ipv6 on affected Linux systems. But one of the recommended workarounds is do do as I have done and place all the rubygem.org ipv4 addresses in /etc/hosts. Some folks have speculated that the problem is with the Ruby Gem utility itself.
 
Top