Gaccm
11-05-2000, 02:09 AM
this is how i set up my linux box to connect to the internet and allow my windows box to use the internet also.
note: this is basicly a NHF, but its not broad enough to fit under that. You can't use this (well some poarts you can) if you have some linux boxs, and only 1 is a server. And, to fully use this, you must use rp-pppoe (unless you already know how to connect to the internet and know a good firewall, i suggest pmfirewall)
Assumptions: all comps have 1 NIC, except the server which has 2, you have the hardware all setup.
Step 1: getting the linux box ready.
Before you add that 2nd NIC, type this at a console:
ipchains -L
if you get an error, or kernel problem, then you don't have ip_masq built into your kernel, your going to have to re-compile your kernel (since your doing this, you should now add the drivers to your 2nd NIC, if the kernel doesn't support it)
if that works, good.
install 2nd NIC, does linux see it on boot up?
type ifconfig -a and if you don't get eth0 and eth1, then it can't see it. Your going to have to recompile your kernel to add support to your card.
you should know have both NICs installed and seeable using ifconfig -a.
setting up eth0 (the externel line, if you using a modem, skip this):
if you have a static ip:
ifconfig eth0 IP netmask DIFFIP
IP= the ip they gave you
DIFFIP = a different ip they gave you
for dynamic (DSL):
ifconfig eth0 0.0.0.0 up -arp
setup rp-pppoe
setup internel network:
ifconfig eth1 169.254.1.1 netmask 255.255.0.0
windows setup:
go to control panel, network, click "TCP/IP-> <your NIC>, then click properties.
under the tap IP ADDRESS
choose specify
type in 169.254.1.2 (the last two numbers can be whatever, as long as it starts with 169.254)
and for netmask 255.255.0.0 (can't change this num)
click GATEAY tab:
put the ip address of the NIC on your linux box (in this case 169.254.1.1)
restart comp.
setup hardware.
they should now be able to ping each other!!!
if they can't: the problem most likely is that the ips weren't typed in correctly. also make sure that linux uses both cards when you type ifconfig (don't put a -a here).
now for the internet part:
the way masquerading is handeld is in your firewall. like i said above, PMfirewall is good for newbies. Since i use rp-pppoe to connect to the internet, i used their built in masquerading firewall.
setup your firewall, making sure masq is included.
YOU SHOULD BE SET.
first try connecting on the linux box, is everything good? if not:
try turning off the firewall, if it works now, try using a different firewall.
dynamic dsl:
make sure to type ifconfig eth0 0.0.0.0 up -arp
before connecting.
it should work now on the linux box.
on win box, try pinging the linux box (i mean eth1), you have to open a DOS prompt in windows (can't do this outside of windows).
now try pinging any server i.e. www.linuxnewbie.org. (http://www.linuxnewbie.org.) did it work?
if it showed: pinging server_name (server_ip) with 32 bits
then you know you can connect to your nameservers. if it doesn't work, go back to linux box, make sure that ipchains -L doesn't give an error.
Now it should work fine.
(you see why this shouldn't be a NHF? http://www.linuxnewbie.org/ubb/smile.gif
note: this is basicly a NHF, but its not broad enough to fit under that. You can't use this (well some poarts you can) if you have some linux boxs, and only 1 is a server. And, to fully use this, you must use rp-pppoe (unless you already know how to connect to the internet and know a good firewall, i suggest pmfirewall)
Assumptions: all comps have 1 NIC, except the server which has 2, you have the hardware all setup.
Step 1: getting the linux box ready.
Before you add that 2nd NIC, type this at a console:
ipchains -L
if you get an error, or kernel problem, then you don't have ip_masq built into your kernel, your going to have to re-compile your kernel (since your doing this, you should now add the drivers to your 2nd NIC, if the kernel doesn't support it)
if that works, good.
install 2nd NIC, does linux see it on boot up?
type ifconfig -a and if you don't get eth0 and eth1, then it can't see it. Your going to have to recompile your kernel to add support to your card.
you should know have both NICs installed and seeable using ifconfig -a.
setting up eth0 (the externel line, if you using a modem, skip this):
if you have a static ip:
ifconfig eth0 IP netmask DIFFIP
IP= the ip they gave you
DIFFIP = a different ip they gave you
for dynamic (DSL):
ifconfig eth0 0.0.0.0 up -arp
setup rp-pppoe
setup internel network:
ifconfig eth1 169.254.1.1 netmask 255.255.0.0
windows setup:
go to control panel, network, click "TCP/IP-> <your NIC>, then click properties.
under the tap IP ADDRESS
choose specify
type in 169.254.1.2 (the last two numbers can be whatever, as long as it starts with 169.254)
and for netmask 255.255.0.0 (can't change this num)
click GATEAY tab:
put the ip address of the NIC on your linux box (in this case 169.254.1.1)
restart comp.
setup hardware.
they should now be able to ping each other!!!
if they can't: the problem most likely is that the ips weren't typed in correctly. also make sure that linux uses both cards when you type ifconfig (don't put a -a here).
now for the internet part:
the way masquerading is handeld is in your firewall. like i said above, PMfirewall is good for newbies. Since i use rp-pppoe to connect to the internet, i used their built in masquerading firewall.
setup your firewall, making sure masq is included.
YOU SHOULD BE SET.
first try connecting on the linux box, is everything good? if not:
try turning off the firewall, if it works now, try using a different firewall.
dynamic dsl:
make sure to type ifconfig eth0 0.0.0.0 up -arp
before connecting.
it should work now on the linux box.
on win box, try pinging the linux box (i mean eth1), you have to open a DOS prompt in windows (can't do this outside of windows).
now try pinging any server i.e. www.linuxnewbie.org. (http://www.linuxnewbie.org.) did it work?
if it showed: pinging server_name (server_ip) with 32 bits
then you know you can connect to your nameservers. if it doesn't work, go back to linux box, make sure that ipchains -L doesn't give an error.
Now it should work fine.
(you see why this shouldn't be a NHF? http://www.linuxnewbie.org/ubb/smile.gif