This month we've got one nitpicker, a few responses to the old mailbag items,
a question about setting up NetBSD 1.4.1 to do large text screens on VGA, and
some new mailbag questions.
Q:
How do I set up a machine with two ethernet cards as a router? (Answer #1)
A:
Run natd (Network Address Translation Daemon) on the machine with two
ethernet cards.
Set one ethernet card to have your externally visible internet address, and
the other to an address in the 10.x.x.x or 192.168.x.x subnets, the network
numbers reserved for internal LAN use.
All of your internal machines should be on the same LAN subnet as the second
ethernet card; connect them up using coax or twisted pair hubs or whatever.
These machines should use the IP address of that second ethernet card as their
default gateway.
Setting up natd does require that you run a firewall which diverts all
traffic through natd.
(This will probably include a kernel recompile.)
Refer to the natd man page which is excellent and should tell you
everything you need to know.
Q:
How do I set up a machine with one ethernet card and a serial modem to act as a PPP gateway? (Answer #1)
A:
First, for all the hosts on your LAN, assign addresses from one of the subnets
that are reserved for local use (10.x.x.x or 192.168.x.x).
Second, make an /etc/ppp/ppp.conf that has the following, modified to
your needs accordingly:
------------BEGIN /etc/ppp/ppp.conf -------------
default:
set log Phase Chat LCP IPCP CCP tun command
set device /dev/cuaa1
set speed 115200
set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \"\" AT \
OK-AT-OK ATE1Q0 OK \\dATDT\\T TIMEOUT 40 CONNECT"
#
# phone is phone number
# replace uname with your ppp usernmae
# replace pass with your password
#
myisp:
set phone 7187300
set login "ABORT NO\\sCARRIER TIMEOUT 5 ogin:--ogin: uname word: pass"
set timeout 600
add default HISADDR
--------------END /etc/ppp/ppp.conf --------------------
Then, edit /etc/resolv.conf if you haven't already (remember to use your
own domain name and nameserver addresses here!):
domain me.com
nameserver 10.1.1.1
nameserver 123.1.1.1
Finally, run ppp -alias myisp to dial up. If you want it to run in the
background, use ppp -auto -alias myisp.
That way, it will dial only when there is outgoing traffic, and disconnect
after your connection has been idle for the number of seconds that you set as
the timeout.
When you use -auto, it is often good to lower the timeout value in
/etc/ppp/ppp.conf.
If you just want to be connected all the time, use -ddial instead of
-auto and it will dial (or redial) immediately, so that it stays
connected.
Q:
How do I set up a machine with one ethernet card and a serial modem to act as a PPP gateway? (Answer #2)
A:
Use the ijppp package for FreeBSD:
Enable the tun driver in your kernel, and set up your ethernet and ppp
interfaces using whatever methods you like.
To enable routing, add a section to /etc/ppp/ppp.linkup:
MYADDR:
delete ALL
add 0 0 HISADDR
Then start ppp with the -alias option (and -auto if you want
dial-on-demand).
On the other machines, set the default gateway to this machine.
If necessary, set the DNS servers on the other machines as well.
More detailed information can be found in the
FreeBSD tutorials.
Q:
I just installed NetBSD 1.4.1, and I want 50 line text screens again.
A:
First, edit /etc/rc.conf and change the line that says wscons=NO
to wscons=YES.
Second, edit /etc/wscons.conf and uncomment this line:
font ibm - 8 ibm /usr/share/pcvt/fonts/vt220l.808
Also, change the bottom of the file to look like this:
#screen 0 80x50 vt100
screen 1 80x50 vt100
screen 2 80x50 vt100
screen 3 80x50 vt100
screen 4 80x50 vt100
screen 5 80x50 vt100
screen 6 80x50 vt100
screen 7 80x50 vt100
This will give you a total of eight screens, accessible by
Ctrl-Alt-Fn where n is 1 through 8 for screens 0 through 7
and devices ttyE0 through ttyE7.
If you want login prompts on all of these screens, you will need to enable them
in /etc/ttys with lines like these:
ttyE0 "/usr/libexec/getty Pc" vt220 on secure
ttyE1 "/usr/libexec/getty Pc" vt220 on secure
ttyE2 "/usr/libexec/getty Pc" vt220 on secure
ttyE3 "/usr/libexec/getty Pc" vt220 on secure
ttyE4 "/usr/libexec/getty Pc" vt220 on secure
ttyE5 "/usr/libexec/getty Pc" vt220 on secure
ttyE6 "/usr/libexec/getty Pc" vt220 on secure
ttyE7 "/usr/libexec/getty Pc" vt220 on secure
It does not appear to be possible to override the 80x25 setting on screen 0
(ttyE0).
This is most likely a feature limitation in the newer driver, intended to help
prevent people from losing their only working console screen.
If you will be running xdm, put this in /etc/wscons.conf:
screen 4 - -
and this in /etc/ttys:
ttyE4 "/usr/libexec/getty Pc" vt220 off secure
This will ensure that your X server can find a free terminal so it will know
when to switch back into graphics mode.
If you want this to be a screen other than 4, then fix things so your X server
is given an argument of the form vtn where n is the same
as the function key number of the screen that you want to reserve for graphics.