Hi,
I'm close to the solution but not yet at it. I've got two internet connections: igb0 connects to local router and get a private 192.168.1.x address and igb1 is connected to another line via bridge and gets a public IP. I want a jail to use igb1 for default route and be accessible also from local network via loopback device or igb0. The latter part is fine, the default route for igb1 is not. Here's what I have:
/etc/rc.conf (relevant parts)
jail.conf
Everything seems fine for
But for fib 1, no default route:
igb1 seems to have acquired an IP as expected by DHCP
In the jail:
So, what should I add/modify in order for my jail to be able to access the internet via fib 1?
I'm close to the solution but not yet at it. I've got two internet connections: igb0 connects to local router and get a private 192.168.1.x address and igb1 is connected to another line via bridge and gets a public IP. I want a jail to use igb1 for default route and be accessible also from local network via loopback device or igb0. The latter part is fine, the default route for igb1 is not. Here's what I have:
# grep fib /boot/loader.conf
Code:
net.fibs=4
net.add_addr_allfibs=0
/etc/rc.conf (relevant parts)
Code:
ifconfig_igb0="inet 192.168.1.30 netmask 255.255.255.0"
defaultrouter="192.168.1.1"
gateway_enable="YES"
cloned_interfaces="bridge0 tap0 lo1 lo2 lo3"
ifconfig_bridge0="addm igb0 addm tap0"
jail_enable="YES"
ifconfig_lo1="inet 127.0.0.41 netmask 255.255.255.255"
ifconfig_igb0_alias0="inet 192.168.1.41 netmask 255.255.255.255"
pf_enable="YES"
ifconfig_igb1="fib 1 SYNCDHCP"
static_routes="dmz internal"
route_dmz_if="-net 95.95.88.0/21 -iface igb1 -fib 1"
route_dmz_gw="default 95.95.95.254 -iface igb1 -fib 1"
route_internal_if="-net 192.168.1.0/24 -iface igb0 -fib 0"
jail.conf
Code:
mldonkey {
interface = "igb1";
exec.fib = 1;
ip4.addr = "lo1|127.0.0.41/32";
ip4.addr += "igb0|192.168.1.41/32";
allow.raw_sockets = 1;
}
Everything seems fine for
setfib 0:: setfib 0 netstat -nr -f inet
Code:
default 192.168.1.1 UGS igb0
127.0.0.1 link#3 UH lo0
127.0.0.41 link#6 UH lo1
192.168.1.0/24 link#1 U igb0
192.168.1.30 link#1 UHS lo0
192.168.1.41 link#1 UHS lo0
192.168.1.41/32 link#1 U igb0
But for fib 1, no default route:
setfib 1 netstat -nr -f inet
Code:
Routing tables (fib: 1)
Internet:
Destination Gateway Flags Netif Expire
95.95.88.0/21 link#2 U igb1
95.95.92.167 link#2 UHS lo0
igb1 seems to have acquired an IP as expected by DHCP
ifconfig igb1 | grep inet
Code:
inet 95.95.92.167 netmask 0xfffff800 broadcast 95.95.95.255
In the jail:
setfib 1 jexec 2 /bin/tcsh
# netstat -nr -f inet
Code:
Routing tables (fib: 1)
=== empty ===
setfib 0 jexec 2 /bin/tcsh #(is well configured)
# netstat -nr -f inet
Code:
Routing tables
127.0.0.41 link#6 UH lo1
192.168.1.41 link#1 UHS lo0
So, what should I add/modify in order for my jail to be able to access the internet via fib 1?