natd & ppp-user startup script

boesemar

Well-Known Member
Mahlzeit,

Ich hab hier eine FreeBSD 5.2-CURRENT box, die sich mit pppoe ins internet einwahlt und nat macht. Ist gerade neu cvsub'ed & make world..

Klappt soweit, nur beim neu-booten startet natd nicht. Ich vermute weil ppp noch nicht den tun0 device aufgebaut hat und so "/sbin/natd -n tun0" fehlschlaegt. Also habe ich in /use/rc.d/natd ne REQUIRE zeile "ppp-user" eingefuegt (nach: "man rcorder") - hilft leider nicht.

Lustig ist: wenn ich nach dem booten "/etc/netstart" aufrufe ist alles so wie ich will - die config sind also alle okay.

Es kann sein dass ppp hier etwas laenger braucht um sich einzuwaehlen - ist ne wireless verbindung.

Configs:

---schnip--- /etc/rc.conf ---:
gateway_enable="YES"
firewall_enable="yes"
firewall_type="/etc/fw.box"
natd_enable="YES"
natd_interface="tun0"
natd_program="/sbin/natd"

# User ppp configuration.
ppp_enable="YES" # Start user-ppp (or NO).
ppp_mode="dedicated" # Choice of "auto", "ddial", "direct" or "dedicated".
ppp_nat="NO" # Use PPP's internal network address translation or NO.
ppp_profile="default" # Which profile to use from /etc/ppp/ppp.conf.
ppp_user="root" # Which user to run ppp as

---- schnip -- ipfw (/etc/fw.box) ---
add 100 allow ip from any to any via lo0
add 1000 divert natd ip from any to any via tun0
add 2000 allow ip from any to any


Bin dankbar fuer jede idee ..

Gruesse,
martin
 
Hi Martin,

boesemar schrieb:
Mahlzeit,

Ich hab hier eine FreeBSD 5.2-CURRENT box, die sich mit pppoe ins internet einwahlt und nat macht. Ist gerade neu cvsub'ed & make world..

Klappt soweit, nur beim neu-booten startet natd nicht. Ich vermute weil ppp noch nicht den tun0 device aufgebaut hat und so "/sbin/natd -n tun0" fehlschlaegt. Also habe ich in /use/rc.d/natd ne REQUIRE zeile "ppp-user" eingefuegt (nach: "man rcorder") - hilft leider nicht.

Lustig ist: wenn ich nach dem booten "/etc/netstart" aufrufe ist alles so wie ich will - die config sind also alle okay.

Es kann sein dass ppp hier etwas laenger braucht um sich einzuwaehlen - ist ne wireless verbindung.

[...]

Bin dankbar fuer jede idee ..

Gruesse,
martin

Ich habe auch (auf einer 4.x) versucht mit natd zuarbeiten, habe dann aber die Nat-funktion im ppp gegnommen.

Aus meiner Konfig:

rc.conf:

firewall_enable="YES"
firewall_type="OPEN"
firewall_logging="YES"
firewall_script="/etc/rc.firewall.local"
ppp_enable="YES"
ppp_mode="ddial"
ppp_nat="YES"
ppp_profile="ddial"
gateway_enable="YES"

Ich weiß nicht, ob dieses unt 5.x klappt, da ich bisher immer nocht 4.9-stable verwende.

Gruß

cvm
 
Geloest! geht auch ohne ppp_nat, das -dynamic flag von natd macht genau das:

-dynamic If the -n or -interface option is used, natd will monitor the
routing socket for alterations to the interface passed. If
the interface's IP address is changed, natd will dynamically
alter its concept of the alias address.

zeile in rc.conf:
natd_flags="-dynamic"

ipfw zeile:
add 1000 divert natd all from any to any via tun0

Guter artikel:
http://www.ruhr.de/home/nathan/FreeBSD/tdsl-freebsd.html

Gruesse,
martin
 
Zurück
Oben