Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
# 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.
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:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.