LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 09-30-2014, 03:15 AM   #1
Bata
LQ Newbie
 
Registered: Sep 2014
Posts: 4

Rep: Reputation: Disabled
IP Forwatding


Hello

I have a Linux Server CentOS 6.3 that has multiple network cards and 10 IP Public, and 10 NIC is connected to the internal network

Now I want the each IP to be forwarded to a client in each network
For example:
IP1: 91.166.22.11.77 Public

NIC1: 192.168.7.1
Client1: 192.168.7.2

Now I forward all ports from IP1 to Client1
In addition, all clients can Internet access via dedicated IP

What IPtables command should I write until ports forward from each Public IP to each Client on private Network...


Thanks for your help

Last edited by Bata; 09-30-2014 at 04:15 AM.
 
Old 09-30-2014, 03:30 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,786

Rep: Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304Reputation: 7304
I think you will need nat: https://en.wikipedia.org/wiki/Networ...ss_translation (if I understand it well)
http://www.howtoforge.com/nat_iptables
http://www.revsys.com/writings/quicktips/nat.html
http://www.karlrupp.net/en/computer/nat_tutorial
 
Old 09-30-2014, 03:50 AM   #3
Bata
LQ Newbie
 
Registered: Sep 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
Smile

Dear friend

I'm a beginner in Linux and I don't have Time enough
I must run that at least for two IPs...

If you can Help me...

I appreciate for Help.
 
Old 10-01-2014, 09:09 AM   #4
Sum1
Member
 
Registered: Jul 2007
Distribution: Fedora, CentOS, and would like to get back to Gentoo
Posts: 332

Rep: Reputation: 30
Please provide the output of ~# route -nve from CentOS server

Please provide the output of ~# ifconfig -a from CentOS server
 
Old 10-01-2014, 09:38 AM   #5
Bata
LQ Newbie
 
Registered: Sep 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
Route:
Destination Gateway Genmask Flags MSS Window irtt Iface
138.183.161.224 0.0.0.0 255.255.255.248 U 0 0 0 eth0
10.224.37.160 0.0.0.0 255.255.255.224 U 0 0 0 eth1
192.168.7.0 0.0.0.0 255.255.255.0 U 0 0 0 tap_soft
192.168.13.0 0.0.0.0 255.255.255.0 U 0 0 0 tap_gw03
192.168.12.0 0.0.0.0 255.255.255.0 U 0 0 0 tap_gw02
192.168.11.0 0.0.0.0 255.255.255.0 U 0 0 0 tap_gw01
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
10.0.0.0 10.224.37.161 255.0.0.0 UG 0 0 0 eth1
0.0.0.0 138.183.161.225 0.0.0.0 UG 0 0 0 eth0


ifconfig:
eth0 Link encap:Ethernet HWaddr 00:16:3E:00:72:4A
inet addr:138.183.161.226 Bcast:138.183.161.231 Mask:255.255.255.248
inet6 addr: fe80::216:3eff:fe00:724a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1030553 errors:0 dropped:0 overruns:0 frame:0
TX packets:1053051 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:420496598 (401.0 MiB) TX bytes:433081169 (413.0 MiB)
Interrupt:21

eth0:0 Link encap:Ethernet HWaddr 00:16:3E:00:72:4A
inet addr:138.183.161.227 Bcast:138.183.161.231 Mask:255.255.255.248
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:21

eth0:1 Link encap:Ethernet HWaddr 00:16:3E:00:72:4A
inet addr:138.183.161.228 Bcast:138.183.161.231 Mask:255.255.255.248
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:21

eth0:2 Link encap:Ethernet HWaddr 00:16:3E:00:72:4A
inet addr:138.183.161.229 Bcast:138.183.161.231 Mask:255.255.255.248
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:21

eth0:3 Link encap:Ethernet HWaddr 00:16:3E:00:72:4A
inet addr:138.183.161.230 Bcast:138.183.161.231 Mask:255.255.255.248
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:21

eth1 Link encap:Ethernet HWaddr 00:16:3E:00:72:49
inet addr:10.224.37.162 Bcast:10.224.37.191 Mask:255.255.255.224
inet6 addr: fe80::216:3eff:fe00:7249/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:228 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:11856 (11.5 KiB) TX bytes:636 (636.0 b)
Interrupt:20

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

tap_gw01 Link encap:Ethernet HWaddr 00:AC:49:6E5:9E
inet addr:192.168.11.1 Bcast:192.168.11.255 Mask:255.255.255.0
inet6 addr: fe80::2ac:49ff:fe6e:d59e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:11594 errors:0 dropped:0 overruns:0 frame:0
TX packets:7925 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:886651 (865.8 KiB) TX bytes:1479564 (1.4 MiB)

tap_gw02 Link encap:Ethernet HWaddr 00:AC:06:34A:46
inet addr:192.168.12.1 Bcast:192.168.12.255 Mask:255.255.255.0
inet6 addr: fe80::2ac:6ff:fe34:da46/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6558 errors:0 dropped:0 overruns:0 frame:0
TX packets:4541 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:588717 (574.9 KiB) TX bytes:954566 (932.1 KiB)

tap_gw03 Link encap:Ethernet HWaddr 00:AC:F5:1C:EC:3F
inet addr:192.168.13.1 Bcast:192.168.13.255 Mask:255.255.255.0
inet6 addr: fe80::2ac:f5ff:fe1c:ec3f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1214 errors:0 dropped:0 overruns:0 frame:0
TX packets:3041 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:104404 (101.9 KiB) TX bytes:251766 (245.8 KiB)

tap_soft Link encap:Ethernet HWaddr 00:AC:5F:F9:0F:90
inet addr:192.168.7.1 Bcast:192.168.7.255 Mask:255.255.255.0
inet6 addr: fe80::2ac:5fff:fef9:f90/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:175582 errors:0 dropped:0 overruns:0 frame:0
TX packets:234341 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:12660483 (12.0 MiB) TX bytes:284721183 (271.5 MiB)


I want configure this:

tap_soft > eth0:0
tap_gw01 > eth0:1
tap_gw02 > eth0:2
tap_gw03 > eth0:3

and I can forward every request from eth0:0~3 to one client in tap_gw network...

I really appreciate..
 
Old 10-02-2014, 09:08 AM   #6
Bata
LQ Newbie
 
Registered: Sep 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
No one in this world answer me.............???????
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



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

All times are GMT -5. The time now is 05:48 PM.

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