
| 機器 | GlobalIP | PrivateIP |
| Router-1 | 43.244.x.34/32( PPPoE ) | 192.168.1.254/24( fxp1 ) |
| Router-2 | 43.244.x.139/32( PPPoE ) | 192.168.2.254/24( fxp1 ) |
cd /usr/ports/net/vtun make make install |
options {
port 5000;
ifconfig /sbin/ifconfig;
route /sbin/route;
syslog daemon;
}
default {
type tun;
proto tcp;
compress lzo:6;
keepalive yes;
encrypt yes;
stat yes;
}
vpn {
pass hogege;
device tun1;
up {
ifconfig "%% 192.168.254.1/32 192.168.254.2 mtu 1450";
route "add -net 192.168.2.0/24 192.168.254.2";
};
down {
ifconfig "%% delete down";
route "delete 192.168.2.0/24";
};
}
|
options {
port 5000;
ifconfig /sbin/ifconfig;
route /sbin/route;
syslog daemon;
}
default {
type tun;
proto tcp;
compress lzo:6;
keepalive yes;
encrypt yes;
stat yes;
}
vpn {
pass hogege;
device tun1;
up {
ifconfig "%% 192.168.254.2/32 192.168.254.1 mtu 1450";
route "add -net 192.168.1.0/24 192.168.254.1";
};
down {
ifconfig "%% delete down";
route "delete 192.168.1.0/24";
};
}
|
/usr/local/sbin/vtund -s |
/usr/local/sbin/vtund vpn 43.244.x.34 |
tun1: flags=8051 |
tun1: flags=8051 |