I Have Multiple Ips But Can Only Telnet To One Interface. Not The Subinterface. How To Fix?

Home » CentOS » I Have Multiple Ips But Can Only Telnet To One Interface. Not The Subinterface. How To Fix?
CentOS 8 Comments

Hi guys,

I have multiple IPs bound to my CentOS 6.6 box but I can only telnet to one IP. Any ideas on what to do? I’ve searched the internet so far with every keyword I can think of to no avail. I can see that postfix is only listening on the first IP and to localhost. The IP I cannot SMTP to is on ETH0:1. I can access it via port 80 (web traffic) but the connection is refused if i try to telnet. [image: :shock:]

The domain I can telenet to is mymodeltalk.com The domain I cannot telenet to is inform.mymodeltalk.com

I have posted my current IP Tables rules, netstat, ifconfig -a, and route
-n. I have SElinux set to permissive.
[root@mail1 log]# netstat -plnt |grep :25
tcp 0 0 172.30.1.113:25 0.0.0.0:* LISTEN 18800/master tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 18800/master

[root@mail1 log]# iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A INPUT -p tcp -m tcp –dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp –dport 587 -j ACCEPT
-A INPUT -p tcp -m tcp –dport 110 -j ACCEPT
-A INPUT -p tcp -m tcp –dport 143 -j ACCEPT
-A INPUT -p tcp -m tcp –dport 993 -j ACCEPT
-A INPUT -p tcp -m tcp –dport 995 -j ACCEPT
-A INPUT -p tcp -m tcp –dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp –dport 25 -j ACCEPT
-A OUTPUT -p tcp -m tcp –dport 25 -j ACCEPT
-A OUTPUT -p tcp -m tcp –dport 80 -j ACCEPT
-A OUTPUT -p tcp -m tcp –dport 587 -j ACCEPT
-A OUTPUT -p tcp -m tcp –dport 9292 -j ACCEPT
-A OUTPUT -p tcp -m tcp –dport 110 -j ACCEPT
-A OUTPUT -p tcp -m tcp –dport 143 -j ACCEPT
-A OUTPUT -p tcp -m tcp –dport 22 -j ACCEPT
-A OUTPUT -p tcp -m tcp –dport 25 -j ACCEPT

[root@mail1 log]# ifconfig -a eth0 Link encap:Ethernet HWaddr 0A:28:21:76:97:85
inet addr:172.30.1.113 Bcast:172.30.1.255 Mask:255.255.255.0
inet6 addr: fe80::828:21ff:fe76:9785/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:9001 Metric:1
RX packets:793739006 errors:0 dropped:0 overruns:0 frame:0
TX packets:480841833 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:937438761212 (873.0 GiB) TX bytes:136066252190 (126.7 GiB)
Interrupt:18

eth0:1 Link encap:Ethernet HWaddr 0A:28:21:76:97:85
inet addr:172.30.1.65 Bcast:172.30.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:9001 Metric:1
Interrupt:18

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:65536 Metric:1
RX packets:369804 errors:0 dropped:0 overruns:0 frame:0
TX packets:369804 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:207298477 (197.6 MiB) TX bytes:207298477 (197.6 MiB)

[root@mail1 log]# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface
172.30.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
0.0.0.0 172.30.1.1 0.0.0.0 UG 0 0 0 eth0

8 thoughts on - I Have Multiple Ips But Can Only Telnet To One Interface. Not The Subinterface. How To Fix?

  • That’s OK… any suggestions? I thought this was a firewall issue but I
    have no idea how to isolate & open ports on a subinterface. I bet the solution is simpler than remembering my own name… smh

  • You are not listening on 172.30.1.65 you need to edit the postfix config to listen on either 0.0.0.0 or both IP’s

    Tris

    *************************************************************
    This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify postmaster@bgfl.org

    The views expressed within this email are those of the individual, and not necessarily those of the organisation
    *************************************************************

  • Hi trish, i have postfix configured to listen on that ip… it’s still not listening.

    see below:

    # Note: you need to stop/start Postfix when this parameter changes.
    #
    #inet_interfaces = all
    #inet_interfaces = $myhostname
    #inet_interfaces = $myhostname, localhost inet_interfaces = 172.30.1.65

    # Enable IPv4, and IPv6 if supported inet_protocols = all

  • There must be something else keeping the instance of postfix from listening on that IP & port. When I set the config to localhost it only sends out using the main postfix instance and it uses the wrong IP to do so. I’m thinking something at the CentOS level. I cannot get the port to open on 172.30.1.65
    regardless of what I try.

    Again here is the config I have in /etc/postfix-immt/main.cf.
    # Note: you need to stop/start Postfix when this parameter changes.
    #
    #inet_interfaces = all
    #inet_interfaces = $myhostname
    #inet_interfaces = $myhostname, localhost inet_interfaces = 172.30.1.65

    # Enable IPv4, and IPv6 if supported inet_protocols = all

    I appreciate all help. I’m extremely desperate at this hour.

  • Are you sure those files are being used, rather than files in
    /etc/postfix? If changes that you make there aren’t affecting the behavior of postfix, the simplest explanation is that they aren’t the correct files.

  • Yes they are being used. There is a command used to create the instance and then I must edit the config files manually. If I put localhost in the secondary instance it binds. Postfix is not the problem. They are saying this is at the OS level which is why I need your help. How do I open the post for a subinterface ETH0:1 for port 25. If that isn’t the solution what other troubleshooting steps should I take from the OS side as POSTFIX isn’t the issue. It can’t hear what it’s not being allowed to listen too.

  • FYI, found out it was Amazon EC2 blocking me upstream of downstream of my config. So everything was configured right… I filled out a form and am waiting for them to fix.