LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-02-2013, 03:06 PM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Rep: Reputation: 177Reputation: 177
I have 2 NIC cards and I think I need 2 gateways?


I have the following /etc/rc.d/rc.inet1.conf:

# Config information for eth0:
IPADDR[0]="xx.yy.zz.95"
NETMASK[0]="xx.yy.zz.192"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""

# Config information for eth1:
IPADDR[1]="192.168.0.3"
NETMASK[1]="255.255.255.0"
USE_DHCP[1]=""
DHCP_HOSTNAME[1]=""

# Default gateway IP address:
GATEWAY="xx.yy.zz.65"

I have a router/firewall at 192.168.0.1 I want to configure the router to port forward some ports to a Windows host (443,80) and I want to forward port 25 to the linux (Slackware) host which has the above rc.inet1.conf settings. The ports forward to the Windows computer just fine, but do not forward to the Linux host. The building network administrator said I had to set the linux gateway to 192.168.0.1 for this to work. I did that, and the forward of 25 to the Linux host started working.

However I can no longer access the eth0 IP properly from outside the LAN. If I ssh to myuser.mydomain.com (which resolves to xx.yy.zz.95) I get no connection and the /var/log/messages file gets an entry, "Apr 2 15:38:50 webserver sshd[10699]: Did not receive identification string from aa.bb.cc.98"

I can, however, telnet to this port and get a connection:

telnet mydomain.com 22
telnet xx.yy.zz.95 22

both of these give me a telnet connection.

Likewise I can telnet to port 80, but I can no longer actually open a web page via my browser, though I don't see an error entry in any logfile.

Does anyone have an idea about what I can do? I've googled around about being able to specify different gateways for the different NICs, but that doesn't seem possible. Right now, I can have Ineternet access, but no port forwarding, or visa versa.
 
Old 04-02-2013, 04:05 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Typically "gateway" is thought of as "default gateway". What you are wanting is to add a "route".

That is done with the "route add" command. I could give you details for how this is all configured in RHEL but not Slackware. It appears however the link below has good examples for Slackware:

http://www.linuxquestions.org/questi...ot-4175455507/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
One NIC, One IP, Multiple Gateways Weirdo0815 Linux - Networking 2 08-26-2010 08:54 PM
2 NIC's with 2 different Gateways carnold SUSE / openSUSE 5 01-02-2010 09:49 AM
NIC, iSCSI, multiple gateways b1f30 Linux - Networking 1 07-04-2008 06:20 PM
Two Nic Cards with Two Gateways will work ? winxandlinx Linux - Networking 2 01-30-2008 01:59 AM
3 network cards and 2 default gateways Oderus Linux - Networking 2 10-20-2004 03:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration