Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2nd NIC ip address

Status
Not open for further replies.

tech4rce

Technical User
Aug 27, 2003
49
CA
Hello all, I've just finished setting my Iptables firewall and it works great (everything is Stealth). Now the for the next step, I'm adding a 2nd NIC, (yes I'm a newbie) this might sound simple to many but I've searched and found nothing on the "Net". The problem is what would be the "Gateway" setting be on the second card?

I'm running Redhat9, etho = Dynamic IP address from ISP
Yes I will be using this box as a "router/firewall".
When I install the second NIC (eth1= internal), it wants to know the Ip address (192.168.0.0)and Gateway (is what?).

Sounds pretty silly, maybe I've been working on the firewall too long and I have a major brain fart here, but I can't figure this one out right now.

Any help would be greatly appreciated.

Thanks
 

Gateways are not really associated with NICs. Tell us what you're trying to do.

What are you connecting the second NIC to?

Cheers
 
I'm making a "router", (two nics, one for the external ie: Internet, the second nic for the Internal network).

External nic is getting it's IP address from DHCP (ISP)
Internal nic is static IP, (192.168.x.x)

When I try to setup the Internal nic, it's asking for a "gateway" address, this is the part that is confusing me. Since it's on the same box, and it has IP Forwarding. Do I just omit the "gateway" or do I (some how) set it up as something else (??).

 
I would omit the gateway address as it is on the internal network and is not needed. Just my opinion and I could be wrong. Will follow this thread to see if any one else has a different view.
 
My 3NIC router uses routes for networks to ensure that the proper routing takes place.

route add -net 192.168.0.0 netmask 255.255.255.0 dev eth1
ifconfig eth1 192.168.0.1
(this gets done in /etc/sysconfig/network-scripts/ifcfg-eth0)

What you should see when you do "route -n" is that the 0.0.0.0 traffic goes out the eth0 device and that 192.168.0.0 goes out the eth1 device. If not, you may need to add the route statement to a startup script to make it stick after reboots.

Your netmasks may vary.

Surfinbox.com Business Internet Services - National Dialup, DSL, T-1 and more.
 

I don't know what is asking for this gateway but I would omit it. Just leave it blank.
If it complains, edit your network setting by hand.

Cheers
 
Thanks for your input, but I figured it out.

etho (external) is set up for DHCP from ISP
eth1 (internal) is set up as static private IP

192.168.0.0
255.255.255.0
gateway = eth0

This is setup in /etc/sysconfig/network-scripts.

The router is now working properly.

Thanks to all.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top