Sunday, December 09, 2018

rtable, rdomain for ppp0 with DHCP assigned IP

Stuck when running cvsync in rdomain 1. It seems cvsync does not using
second routing table because of pf.conf misconfiguration or something.

em0 as a main ISP channel, ppp0 works as reserved wireless ISP channel.
Some system services like cvsync, git, ntp should use second routing
table (rtable 1) assigned to ppp0.

# route -T1 exec cvsync -c /etc/cvsync.conf
Connecting to cvsync_server_remote_IP port 7777
host cvsync_server_remote_IP port 7777: Can't assing requested address
service is not available at cvsync_server_remote_IP port 7777

--- configs
# cat /etc/hostname.em0
rdomain 0
dhcp

# cat /etc/hostname.ppp0
rdomain 1
dhcp

# pppd call ISP

# ifconfig ppp0
ppp0: flags=8051<UP,POINTTOPOINT,RUNNING,MULTICAST> rdomain 1 mtu 1500
index 7 priority 0 llprio 3
grups: ppp
inet ISP_ppp0_gateway --> local_ppp0_IP netmask 0xffffffc0

# route -T1 show
local_ppp0_IP ISP_ppp0_gateway_IP UH Prio 8 ppp0
ISP_ppp0_gateway_IP ISP_ppp0_gateway_IP UHl Prio 1 ppp0

# cat /etc/pf.conf
...
match out on rdomain 0 from lo0 to any nat-to (em0) port 1024:65535 rtable 0
match out on rdomain 1 from lo0 to any nat-to (ppp0) port 1024:65535
rtable 1
...
pass out quick on ppp0 inet proto tcp from (ppp0) to any port 7777 flags
S/SA modulate state queue cvs
...

No comments:

Post a Comment