#edit /etc/gettytab -- at the bottom type: user|Autologin console:\ :ht:np:sp#115200:al=user -- save the file #edit /etc/ttys -- look for the line starting with : ttyv0 and change it to: ttyv0 "/usr/libexec/getty user" xterm on secure -- save it
#cd /usr/src/sys/i386/conf #cp GENERIC ROUTER #echo option ROUTETABLES=6 >> ROUTER #cd /usr/src #make kernel #install kernel #reboot
(examples made for this purpose!) #cat /etc/pf.conf | grep rtable pass in log on tun0 inet proto icmp from any to (tun0) icmp-type rtable 0 pass in log on tun1 inet proto icmp from any to (tun1) icmp-type rtable 1 pass in log on tun0 inet proto tcp from any to (tun0) port ssh rtable 0 pass in log on tun1 inet proto tcp from any to (tun1) port ssh rtable 1 pass in log on em0 inet proto tcp from em0:network to (em0) port 22 rtable 0
(examples made for this purpose!) #cat /etc/rc.conf | grep ssh sshd_enable="YES" # This is now handled by /etc/rc.local
(examples made for this purpose!) #cat /etc/rc.local # # /etc/rc.local # # Build my alternate routing tables /usr/sbin/setfib 0 /sbin/route add default 20.0.0.1 /usr/sbin/setfib 1 /sbin/route add default 30.0.0.1 # Start SSH daemons for each interface /usr/sbin/setfib 0 /usr/sbin/sshd -f /etc/ssh/sshd_config.lan /usr/sbin/setfib 0 /usr/sbin/sshd -f /etc/ssh/sshd_config.tun0 /usr/sbin/setfib 1 /usr/sbin/sshd -f /etc/ssh/sshd_config.tun1
kldload netgraph kldload ng_ether kldload ng_one2many kldload ng_socket ifconfig xl0 up ifconfig xl1 up ifconfig xl2 up ngctl mkpeer xl0: one2many upper one ngctl connect xl0: xl0:upper lower many0 ngctl connect xl1: xl0:upper lower many1 ngctl connect xl2: xl0:upper lower many2 ngctl msg xl1: setpromisc 1 ngctl msg xl1: setautosrc 0 ngctl msg xl2: setpromisc 1 ngctl msg xl2: setautosrc 0 ngctl msg xl0:upper setconfig "{ xmitAlg=1 failAlg=1 enabledLinks=[ 1 1 1 1 1 1 ] }" ifconfig xl0 192.168.100.1/24
#ifconfig xl0 up #ifconfig xl1 up #ifconfig lagg0 create #ifconfig lagg0 up lagproto lacp laggport xl0 laggport xl1 192.168.1.1/24
# ifconfig lagg0 lagg0: flags=8843metric 0 mtu 1500 options=8 ether 00:05:5d:71:8d:b8 inet 192.168.1.1 netmask 0xffffff00 broadcast 10.0.0.255 media: Ethernet autoselect status: active laggproto lacp laggport: xl1 flags=1c laggport: xl0 flags=1c
# ifconfig lagg0 lagg0: flags=8843metric 0 mtu 1500 options=8 ether 00:05:5d:71:8d:b8 inet 192.168.1.1 netmask 0xffffff00 broadcast 10.0.0.255 media: Ethernet autoselect status: active laggproto failover laggport: xl1 flags=0<> laggport: xl0 flags=5
ifconfig_xl0="up" ifconfig_xl1="up" cloned_interfaces="lagg0" ifconfig_lagg0="laggproto lacp laggport xl0 laggport xl1 192.168.1.1/24"
ifconfig wlan0 wlan0: flags=8843metric 0 mtu 1500 ether b8:ee:65:5b:32:59 groups: wlan ssid Bbox-A3BD2403 channel 6 (2437 MHz 11g ht/20) bssid 00:37:b7:56:4b:60 regdomain ETSI country FR indoor ecm authmode WPA2/802.11i privacy ON deftxkey UNDEF AES-CCM 2:128-bit txpower 30 bmiss 7 scanvalid 60 protmode CTS ampdulimit 64k ampdudensity 8 shortgi -stbctx stbcrx -ldpc wme burst roaming MANUAL media: IEEE 802.11 Wireless Ethernet MCS mode 11ng status: associated nd6 options=29
ifconfig xl0 ether b8:ee:65:5b:32:59 ifconfig wlan0 create wlandev ath0 country NL ssid my_wifi up ifconfig xl0 up ifconfig lagg0 create ifconfig lagg0 up lagproto failover laggport xl0 laggport wlan0 (check if things look ok) ifconfig lagg0 lagg0: flags=8843metric 0 mtu 1500 options=8 ether b8:ee:65:5b:32:59 laggproto failover lagghash l2,l3,l4 laggport: xl0 flags=5 laggport: wlan0 flags=0<> groups: lagg media: Ethernet autoselect status: active (get an ip address using dhcp) dhclient lagg0
ifconfig_re0="ether b8:ee:65:5b:32:59" wlans_ath0="wlan0" ifconfig_wlan0="WPA" create_args_wlan0="country NL" cloned_interfaces="lagg0" ifconfig_lagg0="up laggproto failover laggport xl0 laggport wlan0 DHCP"
network={ ssid="myssid" psk="mypsk" }