Networking :: Iptables - Portforward To External IP And Ports?

Jun 30, 2011

I want to portforward client connections from an ubuntu lts server to another external server. btw i am a noob on iptables. i have tryed using the basic commands for iptables with no success. For example:iptables -A PREROUTING -t nat -i eth1 -p tcp --dport 7878 -j DNAT --to 91.23.45.67:7878iptables -A FORWARD -p tcp -i eth1 -o eth0 -d 91.23.45.67 --dport 7878 -j ACCEPTso basically i just want a rediraction for from one ip to another. Example: A client tries to connect to ip 123.45.67.89 on port 7878 and the server forwards him to ip xx.xx.xx.xx on port 7878, meaning that xx.xx.xx.xx is the actual server with services. Server with ip 123.45.67.89 is only forwarding the client to external ip... how can this be done in a simple command?

View 7 Replies


ADVERTISEMENT

Networking :: Cant Open Any Ports In Iptables?

May 14, 2009

Since there was no response on my other post which i spent about a hour writing, ill go for something simpler. I run this on my server

Code:
# set default policy for the NAT table
iptables -t nat -P PREROUTING ACCEPT

[code]...

View 9 Replies View Related

Networking :: Forwarding Ports With Iptables?

Dec 23, 2010

I am running a server with ssh and a vpn server set up. It is behind a debian router with a firewall which uses iptables. i have it set up to forward ports 22 and 443 to ssh on a computer within the LAN(so when on a restricted network i can still ssh into my network) and forward anything to 1723(for my vpn) to that box also. However, the only port that gets successfully forwarded is port 22. The other two appear closed. here is what the script looks like:

Code:
#!/bin/sh
#

[code]...

View 2 Replies View Related

Fedora Networking :: Iptables On Bridge Ports?

Apr 21, 2011

I'd like to pass all traffic between bridge ports via the FORWARDING chain, so I changed following sysctl parameters:

Code:
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1

[code]...

View 1 Replies View Related

Networking :: Set Any Ports On Iptables For One Specific Host Only?

Feb 16, 2011

I like to set in iptables to allow access from one host to my server on any ports.

Currently the iptables have been configured to deny all and to allow access only to those I've specified.

Can anyone advice on the command to achieve this?

View 1 Replies View Related

Ubuntu Networking :: Set Any Ports On Iptables For One Specific Host Only?

Feb 15, 2011

I like to set in iptables to allow access from one host to my server on any ports.Currently the iptables have been configured to deny all and to allow access only to those I've specified.

View 2 Replies View Related

Networking :: Configuring Iptables To Locally Translate Some Ports?

Apr 27, 2011

Because my ISP is blocking every IP port under 1000, I'd like my local nat'ed server to be able to translate incoming and outgoing traffic from some port above 1000 to the default server port locally.Example :

To connect to my IMAP server (default port : 143) from the outside,I'd connect to my public IP, port 1143 (opened and nat'ed to the right server on my router) and the server would translate this port to 143 on the same machine.I wish I could simply configure my router to do that but sadly Linksys doesn't permit such setting... I also could modify the listening port of my server but I prefear to keep the default port inside my network.I think that iptables is the right tool to do that and I never used it and I must say that this tool is not so easy to configure at first sigh

View 5 Replies View Related

Networking :: SQUID Intercept IPtables - Whitelisting Ports And Sites

Jul 6, 2011

I'm having some issues settings up a transparent proxy server, which should allow only regular web browsing (port 80), any other port (including HTTPS (443)) has to be blocked, as well as any other port. Right now, I'm using Debian 6 and Squid3. The server only has one NIC. The topology is like this:
Clients <-> Proxy Server + DHCP Server <-> Internet

With this setup, the network does have internet access and the websites I whitelisted are the only ones accesible via browser, however port block is not working, every port is open, hence why trying to access blacklisted websites through HTTPS is possible. Seems to me Squid3 is doing it's job fine, however IPTABLES for some reason seems to be redirecting all the trafic to port 3128 (Squid3 port). I could be wrong, but I've been unable to do anything related to ports with squid3 (either whitelisting or blacklisting).

For Iptables I used:
Code:
iptables -A PREROUTING -t nat -i eth0 -p tcp -j REDIRECT --dport 80 --to-port 3128
iptables -A INPUT -i eth0 -m tcp -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -i eth0 -m tcp -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -i eth0 -m tcp -p tcp --dport 3128 -j ACCEPT
iptables -A INPUT -i eth0 -m tcp -p tcp --dport 443 -j DROP

Squid3 config:
Code:
acl manager proto cache_object
acl localhost src 127.0.0.1/32 ::1
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
acl Safe_ports port 80 # http
acl whitelist dstdomain "/etc/squid3/whitelist"
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny !whitelist
http_access allow localhost
http_access allow all
http_port 3128 intercept
hierarchy_stoplist cgi-bin

View 2 Replies View Related

Ubuntu Networking :: Iptables: Natting A Machine Only On External Connections

Mar 22, 2011

I've got the following two subnets.

Code:
Subnet 1: 10.1.0.0/24
Subnet 2: 172.16.0.0/24

A machine in subnet 1 is natted to a static address in subnet 2. For instance 10.1.0.10 is natted to 172.16.0.10.

I have achieved this with the following iptables rule. (in addition to enabling forwarding)

Code:
iptables -t nat -A POSTROUTING -s 10.1.0.10 -j SNAT --to 172.16.0.10

So far this works perfectly. What I want to do now is to add another rule that only nats the machine in case it is NOT accessing subnet 1.

In other words, when this machine accesses any other machine in subnet 1, it should show up as 10.1.0.10. Whenever it accesses subnet 2 of anything else, it should appear as 172.16.0.10.

View 1 Replies View Related

Security :: Anyway To NOT Log Dropped Ports 137 / 138 In Iptables?

Mar 30, 2011

We do NOT support samba on our Unbuntu servers but still zillions of windows machines are constantly trying to connect on the SMB ports. I've added a rule that drops access to destination ports 137-138 and that seems to work. But it creates many many log entries documenting that the packet has been dropped. I've been researching and cannot come up with a way to suppress logging for these drops.

View 4 Replies View Related

Software :: Configure IPTABLES To Allow Certain IP Ranges To Ports 25 And 465?

Feb 16, 2011

I have a mail server with IPTABLES enabled.I want to allow access to:

41.0.0.0/8
58.0.0.0/8
61.0.0.0/8

[code]....

View 7 Replies View Related

Software :: Open Ports Using Iptables From Shell?

Sep 18, 2009

I am trying to open VNC ports(5901,5902) on my RHLinux machine using iptables. I am able to do it from GUI system-config-security. Go to the Administration > Security Level and Firewall, then select "other ports" at the bottom and enter the portNum 5901 to open and select tcp, then click OK and OK again to save your settings. From my windows m/n iam able to open vncsession using vncviewer on 5901 port.But when I am trying to do it from command line:#iptables -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPTThis command added the entry in /etc/sysconfig/iptables and listed in iptables -L command.Then I saved and restarted the iptables.#service iptables save
#service iptables restartWhen I am trying to open the VNC session from vncviewer, it is giving me error and session not opened.Is there some thing I missed here? where can I check the logs for this? I definetly need

View 3 Replies View Related

OpenSUSE Network :: Block All Ports But Port 80 With Iptables (DMZ)?

Jun 25, 2010

I have a Suse 10.3 router with 4 network cards. 1 is to connect to the big network and thereby also the internet, 2 are for 'client' subnets and I want to use the last one as a DMZ. In this DMZ will be a web server which has to be accessible from the other 2 subnets and from the big network. I could do it with a few simple clicks in Yast firewall, but I have some issues with this firewall and there for I want to use it as minimal as possible, using Iptables.

So now I'm struggling a bit with Iptables. Basicly what I'm looking for is how to block all ports but 80 in this last subnet with iptables.

View 5 Replies View Related

General :: Block All Ports Except SSH / HTTP In Ipchains And Iptables?

Jun 15, 2010

How can I block all ports except

ssh (port 22)
httpd (port 80)

using iptables and iphains?

View 1 Replies View Related

Ubuntu Security :: Block All Ports Except Pop And Smtp In NAT Through Iptables?

Jan 20, 2010

how to block all ports except pop,pop3,smtp in nat using iptables in squid on redhat A3

View 2 Replies View Related

Ubuntu Servers :: Iptables Allow Ports To A Specific Ip Or Domain Name?

Jul 23, 2010

How to configure iptables to allow only 22,80,3306 ports for only a dynamic public ip/dyn dns domain name on a ubuntu server?

View 9 Replies View Related

CentOS 5 :: Edit The Iptables To Include Some Ports/ip For Openfire Server?

Jun 16, 2010

I am trying to edit the iptables to include some ports/ip for openfire server. The problem is the computer is very locked down with permissions...I logged in as ROOT with ID 0.Now the iptables has ROOT for permission BUT ID 1 which reflects BIN.As root i cant edit or chmod/chown the iptables. Here is what i tried:

1. change password of BIN - successfully changed with no errors BUT still cant su BIN with the new password...

2. tried changing the ID of ROOT to 1 but I dont have permission to use the command....

so anything i can do here??? I dont have permission with Shadow either...

View 3 Replies View Related

General :: Properly Portforwarding The External IP With Iptables

Jul 2, 2011

I am trying to forward all the incoming internet/LAN requests on port 80 to my local machine (running Apache), current iptables work (forward incoming internet traffic to my desktop, but if I try to access it from my local network it won't work. Interface connecting my Ubuntu server to the internet is ppp0 (dialed DSL connection through my router that is in bridge mode) which is connected to the eth0 and eth1 is connected to my internal LAN.

[Code]...

what i was able to gather so far (via logs), is that accessing external server ip directly from the LAN goes directly to eth1 which is understandable (i think). So what i need now (i guess) is an rule that will forward the LAN traffic on eth1 without interfering with the ppp0 prerouting rule (as forwarding all the incoming traffic on eth1 to my local machine will break the internet connection)

View 1 Replies View Related

Hardware :: Multiserial Ports Identification / How Many Ports Are There

Dec 17, 2010

I'm writting an app for desktop and embedded linux and I need to get information about the multiserial port, and I need to know which port is been used (by a printer, por example).The multiserial I'm using is an Altera Corporation Device 0004, and I just need to tell how many ports are there and how many is been used.

View 3 Replies View Related

Networking :: SSH - Forward Several Ports At Once?

May 10, 2011

I can successfully forward a port via:

PHP Code: ssh -L 5900:localhost:5900 test@192.168.5.1 

how do I forward several ports at once. This is a wrong example but:

[Code]...

View 2 Replies View Related

Fedora Hardware :: Tell If USB Ports Are 2.0 Ports?

Aug 11, 2010

How can I tell if my USB ports are 2.0 ports?

View 1 Replies View Related

Ubuntu Networking :: 9.10 - Too Many Open Ports For ISP

Apr 6, 2010

A few months ago I installed Ubuntu 9.10 on my girlfriends laptop, on her request, as she didn't like Windows any more. Since then the internet connection periodically slows down due to too many open ports/connections. Always when this happens I call our ISP and usually there are around 80-200(!) active connections to various IP's.

She is not downloading torrents or anything.
She only uses Firefox and a few open tabs as people do.
Skype is open.
Wireless internet connection.

I am thinking either Ubuntu is updating more or less constantly or the ports/connections aren't closed "after use".

View 7 Replies View Related

Ubuntu Networking :: How To Enable Ports In 10.04

May 8, 2010

Does any body know how to enable ports in ubuntu 10.04?

View 2 Replies View Related

Ubuntu Networking :: Restrict VPN To Certain Ports?

May 12, 2010

I'm trying to VPN in somewhere and it doesn't like any outbound connections. I'm doing this for RDP, so can I somehow restrict the VPN connection to only be using the RDP port?

View 1 Replies View Related

Ubuntu Networking :: All Ports Appear To Be Blocked?

Jun 12, 2010

I dont know how, but somehow all the ports on my comp appear to be blocked except for 24, for ssh and 5900 unknown. I can connect to the network, but as far as I can tell, I'm powerless to do anything. No webpages load, I'm typing this on my phone.

View 1 Replies View Related

Ubuntu Networking :: What Ports And Protocols For Ssh?

Aug 12, 2010

I have ssh running on port 22 and that is the only thing I want in/out of this particular box (ssh, scp).But when I use iptables to set the default policies for INPUT, FORWARD, and OUTPUT to DROP and then allow 22:

iptables -I INPUT -p tcp --dport 22 -j ACCEPT
iptables -I OUTPUT -p tcp --dport 22 -j ACCEPT

ssh stops working.

View 2 Replies View Related

Ubuntu Networking :: How To Block Ports

Dec 16, 2010

I was following the directions over on the page How to watch Hulu overseas without a proxy server and got to the section about blocking ports, which I need to block port 1935. I figured this would be easy, as the mac instructions are

Code:
sudo ipfw add 0 deny tcp from any to any 1935
sudo ipfw add 0 deny udp from any to any 1935
and the Windows instructions are practically a book in itself. Since this page was lacking instructions on how to do it in Ubuntu, and ipfw seemingly doesn't exist in Ubuntu, how do I block the ports

View 2 Replies View Related

Ubuntu Networking :: Ports Won't Open?

Apr 5, 2011

I'm trying to open my ports all the way, but for some reason, I am unable to do so. I've forwarded the ports I want open in my router (I switched between two routers to make sure), I made exceptions in Firestarter, and I even added UFW rules, but when I use pretty much any and every port checking tool out there, the ports eithere back stealthed or closed.I'm not a complete noob, and I'm not an expert, but I'm p sure I'm doing everything right, seeing as there isn't much to screw up.The reason I'm trying to fully open these ports is because I'm getting this dumb 'No Incoming Connections

View 3 Replies View Related

Networking :: Configuring Two Ethernet Ports?

Apr 16, 2010

I have a system with one (sometimes two) ethernet ports, that works happily in an old Fedora 5 build. But I can't get it to work on a new Centos 5.4 build. Original system: One dedicated ethernet port on card always connected to the systems dedicated equipment and no external access (the system is the DHCP master for that network). An optional second USB dongle that is a second ethernet port, used for debugging and development. (This is a DHCP client with full conectivity. In /etc/sysconfig/network-scripts I have ifcfg-eth0, ifcfg-eth1 and a route-eth0. Neither of the ifcfg files needs an explicit HWADDR, which means the same ones work for all boxes. And when one needs to be connected to the network all is fine.

The system is being moved to Centos 5.4, most is working with minimal change, but I am having problems with the ethernet ports. If it only has the on board ethernet connected, all is fine. If you have the USB dongle connected things go wrong: This system brings up the USB ethernet first, and tries to assign it to eth0 (which fails), and then brings up the on board ethernet as eth1 (which also fails). I have tried forcing the behaviour of the network by setting the HWADDR(s), but this does not result in the on board coming up as eth0, it comes up as __tmpxxxx as follows:

ifconfig -a
__tmp226406138 Link encap:Ethernet HWaddr 00:80:66:07:A8:63
BROADCAST MULTICAST MTU:1500 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:1000

[Code]...

Currently the only solution is to unplug the USB dongle through restart and plug in afterwards, and this wont work when the unit is remote and in the field.

View 14 Replies View Related

Networking :: International Blockage On Ports?

May 23, 2011

As of 5 days ago I lost connectivity on HTTP, SSH, and SIP to any international address expect within South Africa.I did contact the service provider and they told me that there are not blocking any ports and everything seems fine on their side. My server is been colocated on their network.Here are our diagnostics1) I can ping from the box to any address using IP and DNS2) I can ping from an international address to the box using IP and DNS.3) I CAN NOT access HTTP, SSH, SIP from any clients outside SA.3b) CAN access all ports within SA.4)NMAP[root@localhost ~]# nmap -T5 -sV localhostInteresting ports on localhost.localdomain (127.0.0.1):

Not shown: 1671 closed ports
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 4.3 (protocol 2.0)

[code]....

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved