how to setup IPs from different subnet on 1 network card, Centos 6.6

660 views Asked by At

one centos 6.6 server, need add 15 Ips to it, my boss gives me 15 Ips from 2 different subnet.

server Ip 173.245.7xx.xxx

ips 173.245.7xx.xxx/29
    23.27.1xxx.xxx/28

this is what I did, all the ips in 173.245.7xx.xxx/29 works fine, all the ips in 23.27.1xxx.xxx/28 I can ping it from other server but can't ssh login. Data-Centre said they didn't block any port, I already turn off iptables.

**ifcfg-eth0**
DEVICE=eth0
BOOTPROTO=none
HWADDR=68:05:ca:xx:xx:xx
IPV6INIT=no
MTU=1500
NM_CONTROLLED=yes
ONBOOT=yes
TYPE=Ethernet
UUID="700defb9-1b49-46d1-932c-xxxxxxxx"
IPADDR=173.245.7xx.xxx
NETMASK=255.255.255.248
DNS2=8.8.8.8
GATEWAY=173.245.7xx.xxx
DNS1=72.13.80.2
USERCTL=no

**ifcfg-eth0:1**
DEVICE=eth0:1
BOOTPROTO=none
HWADDR=68:05:ca:xx:xx:xx
IPV6INIT=no
MTU=1500
NM_CONTROLLED=yes
ONBOOT=yes
TYPE=Ethernet
UUID="700defb9-1b49-46d1-932c-xxxxx"
IPADDR=173.245.7xx.xxx
NETMASK=255.255.255.248
DNS2=8.8.8.8
GATEWAY=173.245.7xx.xxx
DNS1=72.13.80.2
USERCTL=no

**ifcfg-eth0:4**
DEVICE=eth0:4
BOOTPROTO=none
HWADDR=68:05:ca:xx:xx:xx
IPV6INIT=no
MTU=1500
NM_CONTROLLED=yes
ONBOOT=yes
TYPE=Ethernet
UUID="ae86ac55-3eeb-41d5-b708-xxxxxxxxx"
IPADDR=23.27.1xx.xxx
NETMASK=255.255.255.240
DNS2=8.8.8.8
GATEWAY=173.245.7xx.xxx
DNS1=72.13.80.2
USERCTL=no
1

There are 1 answers

2
Carl Trask On BEST ANSWER

If you can ping the server from other computers the connections should be fine. Please verify this...it will narrow the problem down.

  • If you can ping all the addresses:

    • Your problem is with your ssh config
    • Look at your ssh.config file. This should be at /etc/ssh or /etc/sshd/
  • Verify the line in there labeled "listenAddress" is either 0.0.0.0 (not a best practice) or the address you are trying to connect on. Take a look at this post it might have your answer.