CentOS 5 Networking :: Port Forwards From 2 Different Gateways?
Mar 24, 2010
I have a CentOS5 box I use to run ASSP for Anti-spam. It has a single NIC. I configure network settings using Webmin. I have two Internet connections managed by different routers.
Both routers port forward traffic on port 25 (SMTP) to the CentOS box. The SMTP connections only work for the router that is the default gateway on the CentOS box! If Router 1 is configured as the default gateway in CentOS then I can Telnet to that routers WAN IP on port 25 and successfully send mail! On Router 2 I get no connection unless I change the default gateway in CentOS to be the IP of Router 2 thern Router 1 SMTP connections will not work! I imagine that CentOS is sending out it's responses to the default gateway instead of the Router that initiated the port forward?
I installed the CentOS v5.4 on a virtual machine vmware server v1.0. I put the the vmware ethernet on bridged mode and now I have an ip address, subnet mask and dns from my dhcp server from the the office where I am. I edit the file /etc/sysconfig/network and I put there the gateway ip. Now is okay but not at my home where I have another gateway ip. a script who switch between my gateways ?
I have forwarded ssh and rdp protocols in the router which is in remote location. And i aslo configured dhcp reservation for my windows server's ipaddress. I have added that reserved ipaddress of windows server in the RDP port forwarding ip. And i connected to windows server through remote desktop with the ipaddress of the router because i needed a public ipaddress to connect. And now i am going to add my linux servers ip also to dhcp reservation and forward ssh port and give that reserved ipaddress. can i connect to linux server with same public ip that i used to connect for windows server?
I have two NICs and both having different IPs and Default Gateways. Now CentOS by default picks only one default gateway and puts entry in routing table (route -n). I want to keep both default gateway in active mode to achieve redundancy. For example if traffic enters through eth0 then it goes out using default gateway of eth0 and if traffic enters from eth1 then it goes out using default gateway of eth1. I use command route add default gw 192.168.0.1 netmask 0.0.0.0 dev eth2 then both default gateways becomes active. Now I want to make sure that when server reboots both default gateways are setup. For this I wrote shell script/sbin/route add default gw 192.168.0.1 netmask 0.0.0.0 dev eth0/sbin/route add default gw 192.168.0.10 netmask 0.0.0.0 dev eth1I am calling this script via /etc/rc.local but it doesn't work on boot time however once server is booted and I execute script (sh script.sh) then it works fine.
I have 3 servers interconnected with IPs 192.168.150.1-3. First two has internet connection and third first server uses them as gateways. After googling and reading howtos I managed to get it working: The firewall for ssh on first server is defined
And on third route is defined like this: Code: ip route add default scope global nexthop via 192.168.150.1 dev eth0 nexthop via 192.168.150.2 dev eth0
It works, but the problem is that connections on third server are shown that their connected from 192.168.150.1 or 192.168.150.2. Are there is any way to keep original connection source address, when connecting to 192.168.150.3?
I'm hosting a Sendmail Cyrus-Imap server on fedora 12. I recently installed a second NIC on a second internet gateway and successfully configured source based routing. Clients are able to connect over the mail.domain.com received from the gateway 192.168.0.1 to the interface 192.168.0.254. ETH0. Clients are also able to connect from pop3.domain.com and smtp.domain.com from the second gateway 192.168.1.1 to the interface 192.168.1.254. ETH1
I have cyrus-imap certs configured for the mail.domain.com and a Sendmial cert configured for mail.domain.com. My question is how would I tell sendmail and cyrus that the mail.domain.com goes out the ETH0 but deliver the second and third cert (eg cyrus sends pop3.domain.com and sendmail sends smtp.domain.com) to clients connected on ETH1?
I`ve got a network (192.168.1.0/24)with common internet gateway (gw 192.168.1.253).Everything works good and i have access to i-net through 192.168.1.253 from all loacl machines. Then I tried to make and internal server as a firewall for local subnetwork. It is CentOS 5.3 based.
Code: [root@router etc]# uname -a Linux router 2.6.9-89.0.16.EL #1 Tue Nov 3 17:15:02 EST 2009 i686 i686 i386 GNU/Linux
Can anyone here point me to a walk-through or discussion of how to use Webmin to set up port forwarding/NAT on a dual-NIC Centos 5.3 box? The layout will be simple:
Internet --- NIC1 [CentOS Box] NIC2 --- Switch to other PCs
We have a BUNCH of exposed services that are on special ports -- for example, to connect to one machine, you go in with [IP_Address]:12000, and to connect to another, [IP_Address]:12002, etc., etc. We're currently using OpenSuse 10.3 on this box, and YaST makes this criminally easy (you give it the incoming port number and the destination IP/port numbers and it just works). But OpenSuse 10.3 is nearing EOL, we're buying a new machine, and I'd like to use CentOS on the new one.
I've read the sparse Webmin documentation in their Wiki, and it leads one to believe that you simply insert a "NAT" rule. But there's obviously something they're leaving out. I *am* opening the ports in the firewall. But when I log in to [IP_Address]:port, it just times out. The port forwarding never occurs. The test in this case is SSH, and I know that SSHD is working properly because I can log into that machine just fine from another PC on the same internal subnet.
i am not able to port 8080 on my CentOS VPS server.I have followed all the instuctions as mentioned on iptables wiki page.Also I am able to telnet my ip address and port number, But can not access from browser.
we are going to install ASTERISK remotely, hence the port 22 in the server has to be open ,Can somebody reply me with exact commands?I tried these commands and got these results
Command : cat /etc/services | grep xxx Result : No Such file or directory Command :netstat -nan | grep 22
I want to do a simple port redirect, i.e. whatever comes trough whatever interface on port AAAA will get redirected to port BBBBI thought that iptables -t nat -I PREROUTING --source 0/0 --destination 0/0 -p tcp --dport AAAA -j REDIRECT --to-ports BBBBhowever it doesn't work, e.g. nc -v -w2 -z localhost AAAA gives:
nc: connect to localhost port AAAA (tcp) failed: Connection refused while nc -v -w2 -z localhost BBBB
I would like to be able to ssh to a TCP port on my server and be directly connected to the serial port @ 115200 Null modem config. Does any body know how one can do this?
i am using centos 5.2 . recently i have implementing transparent proxy but i faced issue. i received lots of messages in dmesg. i have 2 machine with same OS another machine are works fine with this same configuration
br0: received tcn bpdu on port 1(eth0) br0: topology change detected, propagating br0: received tcn bpdu on port 1(eth0) br0: topology change detected, propagating br0: received tcn bpdu on port 1(eth0)
Would like to seek your support and idea about the having 2 IP addresses bind to my server.I am using a Dell Server coming with 2 Gigabit Ethernet ports -- eth0 and eth1.After CentOS 5.4 installation, if we assign 2 IP addresses 192.168.1.1 and 192.168.1.2(both in the same subnet - 255.255.255.0) to the 2 NIC. The default gateway is 192.168.1.254.We found the following phenomenon:1. If we unplug the cable connecting eth0, eth1 will be disconnected as well.2. The connection to the server, like SSH, FTP, experience frequently disconnection.My questions:1. If we want to connect both cables to the 2 ports, how can we make them independent and actas normal? That means both ports are functioning independently.2. Is the any build in function in CentOS that can bind 2 NIC as 1?
Last night I installed all the updates that were available for CentOS. Today, I discovered that all connections to port 25 (Sendmail) are being blocked except connections coming from localhost.
I tried disabling the firewall to see if anything would change but it is still blocked.
If it is not the firewall doing the blocking, what else might it be?
Recently I discovered that we were accidentally running a POP server (port 110), when we only should have been running the encrypted version thereof (port 995). This wouldn't have been a problem if the port was blocked in the first place.Isn't the default iptables setup on CentOS to block unspecified ports? Specifically, this line from /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
Right? Well, this doesn't seem to be working for me. I added some rules to allow additional ports and commented out a couple (crucially port 110), but for some reason, port 110 is open.Here is /etc/sysconfig/iptables and the output of iptables -L below that:
# cat /etc/sysconfig/iptables # Firewall configuration written by system-config-securitylevel # Manual customization of this file is not recommended. *filter :INPUT ACCEPT [0:0]
[code]....
Why isn't "-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited" doing what I think it should be doing?
I have a server hosting with in a DC and I have two subnet on 1 VLAN. how can I add all the IPs from these two subnet in one go? lets say for instructional purpose they are 192.168.0.0/24 and 192.168.1.0/24
I have configured NFS Server on CentOS 5.2 with IBM Web Server,which is having AIX 5.3 The IBM Web Server can upload all data onto NFS Server. Now, Today i was having slow response on IBM Web Server & by measuring the NFS, i found below error while running "tcpdump" command on CentOS Server.
tcpdump -n -i eth1 | grep 2049 18:36:37.237451 IP 10.100.19.241.2049 > 10.100.19.88.1758143293: reply ok 1448 read [|nfs] 18:36:37.237476 IP 10.100.19.241.2049 > 10.100.19.88.539981409: reply ERR 1448 18:36:37.237481 IP 10.100.19.241.2049 > 10.100.19.88.796287348: reply ERR 1448
[code]....
I have changed Network Card in CentOS. All LAN is on Gigabit Network. Also I have changed the Network Cable(Patch Cord). But,still no response.
I have a server in a colocation environment where I'm allotted 25Mbps. I'd like to avoid exceeding that for obvious reasons. Is there a way I can set the link speed or at least throttle the bandwidth for all services?
Can anyone tell me if there is a port of the FreeBSD PPP daemon called MPD5? I would like to run this on my CentOS installation as I understand this is better than pptpd?
A lot of activity is happening on our local server and I want to know which port is getting the most used and which daemon is using the port. I think it will be some modification of netstat command.
Here is my network diagram ADSL router----firewall--LAN inside the LAN my squid is running. currently all users are working with out proxy server. I installed the proxy server inside the LAN. now all users can access web browsing ,but no other ports are working , like POP3, smtp, then some other TCP port based applications are not working. My firewall ( juniper) is created and tested the rules to allow the POP3 and smtp and selected poprts which is working , but I redirected through squid proxy server the clients are not able to access. where do I have to create rules?
** in squid proxy( i already did in safe port list stillnot working) ** IP tables?
I am running OpenVZ.I wanted to use the VPSs IP at a particular port to load the Servers Web Pages e.g. The IP 88.88.88.88 is the VPS IP and 77.77.77.77 is the servers main ip.My files are on the main server at /usr/local/pages/
I want to load the page from the URL: https://88.88.88.88:8888
These should load the files from the main server at /usr/local/pages/ Virtuozzo a OpenVZ panel does it. So how is this going to be possible ? Will DNAT do the trick : iptables -t nat -A PREROUTING -p tcp -d 88.88.88.88 --dport 8888 -i eth0 -j DNAT --to-destination 192.168.0.1:8888
I am new to iptables. The setup tool on a VPS doesn't work. So, I am learning to insert rules. I have inserted so many and some of them show as duplicates now.
1- I want to know how to remove the duplicates. Is there a file that these rules are store in so I can go in and easily edit it?
2- Is there any other utility that handles firewall in Linux that I am unaware of? or is the iptables the ultimate door guard? This is a plain install of CentOS.
3- Since I believe I opened port 5090 but I think it still might be blocked, could SELINUX be the problem? How can I get my way around setting it to permissive or disable if I don't have access to "setup" command?
4- What is the order of iptables reading? does rule #1 supersede all other rules? or does the last rule supersede all rules prior to it?
5- Do the rules below make a fairly safe system? (except for the duplicates which should be remove) I understand that a safe system is dependent also on the applications that are allowed in this category and I am not talking about those. I am talking about dropping all other inquiries and in general is this how iptables are setup? This is what I currently have:
[root@tel ~]# service iptables status Table: filter Chain INPUT (policy ACCEPT) num target prot opt source destination
My first time installing centos server and adding it to xp home network. I am new to setting up my own network in general. I have a home windows wired ethernet xp network (simple linxs router) with 2 xp boxes and one centos5 box all connected to the same router. I just set up the centos box running tomcat on port 8080. I need to do two very basic things at this point, but am not sure what I need to do:
What do I need to do so I can: 1. Connect in firefox on one of my xp boxes and call the tomcat server running on my centos box? 2. Be able to ftp to centos box from either of my xp boxes?
I have 2 server behind the netgear router on my network . win2k3 and CentOS development server, I have port forarded 80 to win2k3 server which i can access over the internet and is accessable. However I can SSH CentOS machine and portforwarded 8080 and 82 for web access, I can't access via any of the port, browsers says UNABLE TO CONNECT.. there is no firewall in CentOS machine.
I'm trying to open up some ports to connect via vnc to a server running Centos 5.5. I've edited /etc/sysconfig/iptables everything *looks* fine, but I still can't seem to get access to the port I've opened (I added some newlines for clarity between commands):