LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-04-2011, 01:34 AM   #1
Senthilv
Member
 
Registered: Jan 2011
Posts: 66
Blog Entries: 2

Rep: Reputation: 0
How to open a port for eth1 ?


I have Linux server (centos) in my company ,
In Server have two Ethernet card we are using one for getting internet connection via eth0 and another one is passing network is shared through this ethernet eth1

Network is shared through this linux squid proxy server to Windows client .

But thing is ....

In Windows client Browsing internet via proxy is fine . But while ping google.com in cmd it say could not connect


How to rectify this ...Tell me any one ...
 
Old 02-04-2011, 05:59 AM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
You should be able to use iptables' NAT functionality to pass the ICMP traffic from one interface to the other.

For example see the following code. It will probably take some tweaking for your purposes (I don't claim that as it is written it will work as you intend) but should give you the idea.

Code:
To accept PING:
-A INPUT -p icmp -m icmp --icmp-type echo-request -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
To pass between the interfaces:
iptables -t nat -A POSTROUTING -i eth0 -o eth1 -j MASQUERADE
 
Old 02-04-2011, 07:55 AM   #3
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 60
Post

Let's see your firewall script that you are presently using. I use this same network setup in 60 schools and don't have an issue with outgoing pings from Windows clients on the network. But with what Noway2 has shown, if you do have to specify some rules to allow, I'd say you'd have to use OUTPUT rules as opposed to INPUT because INPUT would be defining ICMP coming from the outside to eth0.

That is if I am understanding correctly that you want to ping out from a windows client going through eth1, then out through eth0 to your destination ping?
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Forward Port 80 from eth0 to eth1 emjga Linux - Networking 1 02-04-2009 12:57 PM
Use eth1 for port 8081 x_terminat_or_3 Linux - Networking 4 04-06-2007 05:36 AM
forwarding a specific port from eth0 to eth1 zovres Linux - Networking 2 05-02-2006 11:01 PM
port forwarding from eth0 to eth1 ? overproof Linux - Networking 7 05-16-2005 03:48 AM
port forward from eth0 to eth1 ryanzietlow Linux - Networking 8 03-01-2005 11:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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