[NTLUG:Discuss] Dual NIC Firewall - Problems with the external NIC

Jack Snodgrass jack+ntlug at mylinuxguy.net
Mon Mar 24 20:56:41 CST 2003


On Mon, 24 Mar 2003 15:49:38 -0600, Chris J Albertson wrote:

>  I'm trying to set up a firewall box with dual NICs. Both NICs get detected by
>  the kernel and everything looks good to there. Set up the internal NIC with
>  ifconfig and give it a static IP. Things are good from there. I then add the
>  second NIC using ifconfig and it too looks good. All local subnet IP addresses
>  resolve on both NICs.
>  The next step is to add a default route for the external NIC to the router
>  that
>  it's connected to. This is where things get hosed.
>  
>  So here is the ultimate question. Can I even have a default gw when I have two
>  NICs? Is that causing too much confusion? I'm adding the default route like
>  this: (Forget about the IP address not being legal for now....)
>  route add default gw 10.10.0.1
>  I would think that if I add the default gw with that IP address, it would
>  realize that it needs to go thru the external nic (eth1) to reach it and all
>  will be fine.
>  
>  Any help you guys can provide would be most excellent!
>  Thanks!

that should work. Do you get an error? 
Note.. (for example) if your setup is this:
eth0 is 172.16.14.2 
netmask is 255.255.255.0 
gw is 172.16.14.1, then 
route add default gw 172.16.14.1 
should work. 

if you've got ( instead ) 
eth0 is 172.16.14.2 
netmask is 255.255.255.0 
gw is 10.10.10.1, ( not on your subnet )  then 
route add default gw 10.10.10.1 
won't work unless you do a 
route add -host 10.10.10.1 eth0 
first. I dont' see this very often. 

what happens when you do the route add default gw x.x.x.x

jack 

 






More information about the Discuss mailing list