LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 11-13-2009, 10:25 AM   #1
gubak
Member
 
Registered: Jul 2004
Posts: 332

Rep: Reputation: 30
Is this routing table OK?


Please take a look at to this routing table:

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
212.200.191.127 0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
93.92.248.248   0.0.0.0         255.255.255.248 U     0      0        0 eth0
5.2.2.0         0.0.0.0         255.255.255.0   U     0      0        0 eth1
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth1
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 ppp0
[root@main ~]#
I have problem with port forwarding. I was already everythig setted but it doesnt work:

In iptables I was put the following:


Code:
iptables -A PREROUTING -t nat -i eth1 -p tcp --dport 80 -j DNAT --to 192.168.1.50:80
iptables -A INPUT -p tcp -m state --state NEW --dport 80 -i eth1 -j ACCEPT
and setted ip_forwarding=1.

Last thing I want to check is routing table.

Is this routing table OK?

My static ip is x.x.x.12 this is an ADSL modem with pppoe connection. If I type command ifconfig I get:

Code:
eth0      Link encap:Ethernet  HWaddr 00:11:6B:95:71:BB
          inet addr:93.92.248.254  Bcast:93.92.248.255  Mask:255.255.255.248
          inet6 addr: fe80::211:6bff:fe95:71bb/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:38307 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24768 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:44213971 (42.1 MiB)  TX bytes:2887391 (2.7 MiB)
          Interrupt:217 Base address:0xe000

eth1      Link encap:Ethernet  HWaddr 00:19:99:54:BC:24
          inet addr:5.2.2.70  Bcast:5.2.2.255  Mask:255.255.255.0
          inet6 addr: fe80::219:99ff:fe54:bc24/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:25811 errors:0 dropped:0 overruns:0 frame:0
          TX packets:36247 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3077989 (2.9 MiB)  TX bytes:43958319 (41.9 MiB)
          Interrupt:169 Memory:df900000-df910000

ppp0      Link encap:Point-to-Point Protocol
          inet addr:x.x.x.12  P-t-P:212.200.191.127  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1480  Metric:1
          RX packets:267 errors:0 dropped:0 overruns:0 frame:0
          TX packets:263 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:27838 (27.1 KiB)  TX bytes:27245 (26.6 KiB)

Thank you!
 
Old 11-13-2009, 03:45 PM   #2
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by gubak View Post
Please take a look at to this routing table:

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
212.200.191.127 0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
93.92.248.248   0.0.0.0         255.255.255.248 U     0      0        0 eth0
5.2.2.0         0.0.0.0         255.255.255.0   U     0      0        0 eth1
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth1
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 ppp0
[root@main ~]#
I have problem with port forwarding. I was already everythig setted but it doesnt work:

In iptables I was put the following:


Code:
iptables -A PREROUTING -t nat -i eth1 -p tcp --dport 80 -j DNAT --to 192.168.1.50:80
iptables -A INPUT -p tcp -m state --state NEW --dport 80 -i eth1 -j ACCEPT
and setted ip_forwarding=1.

Last thing I want to check is routing table.

Is this routing table OK?

My static ip is x.x.x.12 this is an ADSL modem with pppoe connection. If I type command ifconfig I get:

Code:
eth0      Link encap:Ethernet  HWaddr 00:11:6B:95:71:BB
          inet addr:93.92.248.254  Bcast:93.92.248.255  Mask:255.255.255.248
          inet6 addr: fe80::211:6bff:fe95:71bb/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:38307 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24768 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:44213971 (42.1 MiB)  TX bytes:2887391 (2.7 MiB)
          Interrupt:217 Base address:0xe000

eth1      Link encap:Ethernet  HWaddr 00:19:99:54:BC:24
          inet addr:5.2.2.70  Bcast:5.2.2.255  Mask:255.255.255.0
          inet6 addr: fe80::219:99ff:fe54:bc24/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:25811 errors:0 dropped:0 overruns:0 frame:0
          TX packets:36247 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3077989 (2.9 MiB)  TX bytes:43958319 (41.9 MiB)
          Interrupt:169 Memory:df900000-df910000

ppp0      Link encap:Point-to-Point Protocol
          inet addr:x.x.x.12  P-t-P:212.200.191.127  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1480  Metric:1
          RX packets:267 errors:0 dropped:0 overruns:0 frame:0
          TX packets:263 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:27838 (27.1 KiB)  TX bytes:27245 (26.6 KiB)

Thank you!
I assume this doesnt work??

Code:
iptables -A PREROUTING -t nat -i eth1 -p tcp --dport 80 -j DNAT --to 192.168.1.50:80
i cant really see how traffic gets to this network - 192.168.1
 
Old 11-13-2009, 09:51 PM   #3
gubak
Member
 
Registered: Jul 2004
Posts: 332

Original Poster
Rep: Reputation: 30
Sorry!

The right record is:

Code:
iptables -A PREROUTING -t nat -i ppp0 -p tcp --dport 80 -j DNAT --to 5.2.2.231:80
iptables -A INPUT -p tcp -m state --state NEW --dport 80 -i ppp0 -j ACCEPT

Last edited by gubak; 11-13-2009 at 09:52 PM.
 
  


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
routing table scofiled83 Linux - Networking 1 11-08-2008 07:40 PM
routing table selie Linux - Networking 2 05-04-2007 09:12 AM
routing table arvind kumar Linux - Networking 2 06-08-2005 11:59 PM
Help with a Routing Table maginotjr Linux - Networking 4 06-06-2005 09:49 AM
routing table upr8830 Linux - Networking 6 06-18-2003 03:04 AM

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

All times are GMT -5. The time now is 09:29 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