Linux - Networking This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
10-15-2014, 04:18 AM
|
#1
|
Member
Registered: Mar 2007
Location: Chandler, AZ
Distribution: Fedora 10,12,and 14
Posts: 62
Rep:
|
How do I configuring Linux as a router
I am trying to configure a Linux router
I am running Centos 6.5 on an i5 quadcore server with 32G of RAM and 80G hard drive
I have 2 NICs eth0 and eth1
eth0 is connected to the internal LAN with a static IP 192.168.0.1/24 with port forwarding turned on.
and eth1 is connected to our public switch with a static IP 140.x.x.127.
I have an internal VMware cloud at 192.168.0.101:9443
I configured the firewall through the GUI. I turned on ports 21 for ssh, 80 for http, 8080 for webcache and 443 for https.
I have masquerading turned on for eth1.
and packet forwarding turned on from eth0 192.168.0.1 to eth1 140.x.x.127
My question is:
how do I configure eth1 140.x.x.127 to redirect packets coming in on 8080 to 192.168.0.101:9443 in the firewall GUI?
Any help would be greatly appreciated.
Thanks,
RonM
|
|
|
10-15-2014, 06:13 AM
|
#2
|
Member
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
|
Quote:
I turned on ports 21 for ssh, 80 for http, 8080 for webcache and 443 for https.
|
ssh is 22
Show "cat /proc/sys/net/ipv4/ip_forward".
Show your "iptables-save" output (with IPs redacted 140.x.x.12 if you wish).
|
|
|
10-15-2014, 11:56 AM
|
#3
|
Member
Registered: Mar 2007
Location: Chandler, AZ
Distribution: Fedora 10,12,and 14
Posts: 62
Original Poster
Rep:
|
how to I configure linux router
Thanks for your quick response. I'm attaching a copy of the iptables and result of ip_forward setting. I appreciate you looking at this.
RonM
|
|
|
10-15-2014, 05:32 PM
|
#4
|
Member
Registered: Mar 2007
Location: Chandler, AZ
Distribution: Fedora 10,12,and 14
Posts: 62
Original Poster
Rep:
|
How to configure a Linux router
Please refer to the attachment for a diagram of the router question.
|
|
|
10-15-2014, 08:10 PM
|
#5
|
Member
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
|
|
|
|
10-15-2014, 08:57 PM
|
#6
|
Member
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 665
Rep:
|
well i guess a route is need to be set here to achieve you want..
see 'route' man page for more.
Code:
route add -host x.x.x.x gw x.x.x.x eth0 (something like this)
|
|
|
10-16-2014, 06:34 PM
|
#7
|
Member
Registered: Mar 2007
Location: Chandler, AZ
Distribution: Fedora 10,12,and 14
Posts: 62
Original Poster
Rep:
|
thanks linosaurusroot
I will check it out and back to you. Thanks again.
|
|
|
10-17-2014, 11:11 AM
|
#8
|
LQ Newbie
Registered: Oct 2014
Location: West Midlands
Distribution: Centos, AmazonLinux, RedHat, Oracle Linux
Posts: 4
Rep:
|
Quote:
How do I configure eth1 140.x.x.127 to redirect packets coming in on 8080 to 192.168.0.101:9443 in the firewall GUI?
|
I did something similar using iptables:-
I am not an iptables expert but I think the config commands you would require are:-
Code:
# Allow portforwarding of 8080 traffic to 192.168.0.101:9443
iptables -A PREROUTING -t nat -i eth1 -p tcp --dport 8080 -j DNAT --to 192.168.0.101:9443
iptables -A FORWARD -p tcp -d 192.168.0.101 --dport 9443 -j ACCEPT
service iptables save
The you would connect to the local IP address on eth1 on port 8080, but the traffic would be sent to 192.168.0.101 port 9443
|
|
|
All times are GMT -5. The time now is 05:03 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|