Click to See Complete Forum and Search --> : 2.4.1, 2 nics, IP Masq


chaoticNight
02-01-2001, 07:26 PM
Hope this same thing hasn't been posted already.


Slackware 7.1

Running 2.4.1 with built in support for the tulip drivers which both of my different pci nics use. I set up eth0 with netconfig before I upgraded from 2.2.16 to 2.4.1 and the nic is still working. However now I would like to use my second nic to set up masq with.

When I boot up eth1 is not configured automatically. If I run ifconfig eth1 192.168.0.1 up the nic will then be working. And I can ping other boxes on my network with it.

How can I set it up to automatically load eth1, I mean like set up ifconfig upon startup. Also anyone know anywhere I can find info on setting up IP Masq and 2.4.1 as well as IP Tables?

thanks!

------------------
...and you never want to come out, because reality is **** and cyberspace is god...

zGoRNz
02-01-2001, 09:18 PM
for ifconfiging at boot, just put the command in /etc/rc.d/rc.inet1

anywhere will do, but try the the bottom

as for masquerading, if you have a static ip:
iptables -t nat -A POSTROUTING -o eth1 -s IPsOfClients (use 0/0 for anyone) -j SNAT --to YOURSTATICIP


i forgot how to do it with nonstatic sorry http://www.linuxnewbie.org/ubb/frown.gif



------------------
Dunt Dunt Duh...
GoRN To The Rescue,
Yet Again
zGoRNz@yahoo.com
aim: GoRNToTheRescue

chaoticNight
02-01-2001, 11:28 PM
Okay the ifconfig worked. Um... the IP Tables command didn't work, I don't think so at least. It came up saying that it couldn't understand the --IP ADDRESS part, and I changed it to both --192.168.0.1 and I tried it without the -- just 192.168.0.1

no go, not recognized... must be a format thing, just making sure... I put that into the rc.inet1 file right?

Also, it seems like after I put that in there my eth1 stopped being pingable from the outside.


------------------
...and you never want to come out, because reality is **** and cyberspace is god...

[GoRN]
02-03-2001, 10:47 PM
here:
iptables -t nat -A POSTROUTING -o eth1 -s 192.168.0.0/24 -j SNAT --to 192.168.0.1

try exactly that, just type it on the command line, then to clear the iptables do:

iptables -F
iptables -t nat -F

if you put it in rc.inet1 it will run at boot, do this after it works

test first.

good luck