2 or n network interfaces (multiple IP/MAC)

13 posts / 0 new
Last post
#1 Sun, 06/16/2013 - 15:56
MrGreen

2 or n network interfaces (multiple IP/MAC)

Hello,

my server is ESXI

i've (for the tests) 2 network interface (eth0 and eth2) with two IP and MAC address.

i've add eth2 on Webmin -> Networking -> Network configuration -> Network Interfaces -> Add a new interface.

with the ip address and mac address

and Webmin -> Networking -> Network configuration -> "Routing and Gateways" with the same gateway of eth0

after on VirtualMin -> Addresses and Networking -> "Shared addresses for any servers" i've add the ip of eth2

and i've create my "Virtual server" with the new ip address "178.33.40.226"

but i can't ping 178.33.40.226 and http://178.33.40.226 don't run...

an idea ? (website and ping on eth0 is ok)

Mon, 06/17/2013 - 07:58
MrGreen

up please, i can't migrate my webserver... stand by fot that...

Thanks

Mon, 06/17/2013 - 09:40
Locutus

Well if you can't even ping your VM on the second IP address, Virtualmin domains certainly won't work. :)

Please answer all of these questions:

  • Which version of VMware ESXi are you using?
  • What Linux distro are you using?
  • What's the output of ifconfig -a?
  • Are you using the correct IP and MAC addresses (i.e. those that your hoster assigned to you)?
  • Did you set the correct MAC address in the VM's configuration?
Tue, 06/18/2013 - 03:36 (Reply to #3)
MrGreen

I've reply to your questions...

is there a iptable command for verify the configuration ? (i really don't understand why i can't ping the eth2 ip address)

Tue, 06/18/2013 - 02:48
MrGreen

Hello, ESXi is V5 (i think)

My linux is Centos 6.4 Yes the mac address is correct on VM, and it's the same as given for my server...

ifconfig -a : eth0 Link encap:Ethernet HWaddr 00:50:56:07:xx:xx inet adr:178.32.xx.xx Bcast:178.32.xx.xx Masque:255.255.255.255 adr inet6: fe80::250:56ff:fe07:xxxx/64 Scope:Lien UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:3160 errors:0 dropped:0 overruns:0 frame:0 TX packets:2173 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 lg file transmission:1000 RX bytes:3743293 (3.5 MiB) TX bytes:170389 (166.3 KiB)

eth2 Link encap:Ethernet HWaddr 00:50:56:03:xx:xx inet adr:178.33.40.226 Bcast:178.33.40.226 Masque:255.255.255.255 adr inet6: fe80::250:56ff:fe03:xxx/64 Scope:Lien UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:48 errors:0 dropped:0 overruns:0 frame:0 TX packets:13 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 lg file transmission:1000 RX bytes:3324 (3.2 KiB) TX bytes:934 (934.0 b)

lo Link encap:Boucle locale inet adr:127.0.0.1 Masque:255.0.0.0 adr inet6: ::1/128 Scope:Hôte UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:192 errors:0 dropped:0 overruns:0 frame:0 TX packets:192 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 lg file transmission:0 RX bytes:15026 (14.6 KiB) TX bytes:15026 (14.6 KiB)

Tue, 06/18/2013 - 04:07
Locutus

To really evaluate this problem, it'd be useful if you posted the full MAC and IP addresses, and not X parts of them out. :)

For now I can see that you have /32 as netmask for your IPv4 addresses, but are not using a point-to-point setup, which is rather unusual. Were you given some instructions by your hoster how to set up the primary and additional IP addresses?

Please post your routing table using the command route -n, and your networking config using cat /etc/network/interfaces. The latter might be different for your distro, I'm using Ubuntu.

To check if the packet filter is dropping packets, you can list the filter table with iptables -L

When you post screen outputs, please enclose them in [code][/code] tags, otherwise linebreaks and monospace font gets lost.

Tue, 06/18/2013 - 10:04 (Reply to #6)
MrGreen

ok,

ifconfig :

eth0 Link encap:Ethernet HWaddr 00:50:56:07:57:F4 inet adr:178.32.97.31 Bcast:178.32.97.31 Masque:255.255.255.255 adr inet6: fe80::250:56ff:fe07:57f4/64 Scope:Lien UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1009 errors:0 dropped:0 overruns:0 frame:0 TX packets:1089 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 lg file transmission:1000 RX bytes:304249 (297.1 KiB) TX bytes:472678 (461.5 KiB)   eth2 Link encap:Ethernet HWaddr 00:50:56:03:0B:0A inet adr:178.33.40.226 Bcast:178.33.40.226 Masque:255.255.255.255 adr inet6: fe80::250:56ff:fe03:b0a/64 Scope:Lien UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:43 errors:0 dropped:0 overruns:0 frame:0 TX packets:13 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 lg file transmission:1000 RX bytes:3135 (3.0 KiB) TX bytes:934 (934.0 b)   lo Link encap:Boucle locale inet adr:127.0.0.1 Masque:255.0.0.0 adr inet6: ::1/128 Scope:Hôte UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:221 errors:0 dropped:0 overruns:0 frame:0 TX packets:221 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 lg file transmission:0 RX bytes:17731 (17.3 KiB) TX bytes:17731 (17.3 KiB)

The hoster ask to set NETMASK="255.255.255.255". it's 32 no ?

route -n

Table de routage IP du noyau Destination Passerelle Genmask Indic Metric Ref Use Iface 176.31.182.254 0.0.0.0 255.255.255.255 UH 0 0 0 eth0 169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0 169.254.0.0 0.0.0.0 255.255.0.0 U 1003 0 0 eth2 0.0.0.0 176.31.182.254 0.0.0.0 UG 0 0 0 eth0

i've no /etc/network/interfaces i've : /etc/sysconfig/network-scripts/ifcfg-eth0

GATEWAY=176.31.182.254 PEERDNS=yes IPV6INIT=no HWADDR=00:50:56:07:57:f4 DNS2=8.8.8.8 BROADCAST=178.32.97.31 USERCTL=no DNS1=213.186.33.99 ARP=yes UUID=15646f8e-e294-4dad-a5ef-7a6a498256a3 NAME="System eth0" BOOTPROTO=none MACADDR="" NM_CONTROLLED=yes TYPE=Ethernet DEVICE=eth0 MTU="" NETMASK=255.255.255.255 IPADDR=178.32.97.31 DEFROUTE=yes NETWORK=178.32.97.31 IPV4_FAILURE_FATAL=yes ONBOOT=yes

and /etc/sysconfig/network-scripts/route-eth0

176.31.182.254 dev eth0 default via 176.31.182.254 dev eth0

and /etc/sysconfig/network-scripts/ifcfg-eth2

GATEWAY=176.31.182.254 NAME=eth2 BOOTPROTO=none MACADDR=00:50:56:03:0b:0a IPV6INIT=no DEVICE=eth2 NETMASK=255.255.255.255 MTU="" BROADCAST=178.33.40.226 IPADDR=178.33.40.226 NETWORK=178.33.40.226 ONBOOT=yes USERCTL=no PEERDNS=yes TYPE=Ethernet ARP=yes HWADDR=00:50:56:03:0b:0a

iptable -L

Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT udp -- anywhere anywhere udp dpt:ftp-data ACCEPT udp -- anywhere anywhere udp dpt:ftp ACCEPT udp -- anywhere anywhere udp dpt:domain ACCEPT tcp -- anywhere anywhere tcp dpt:dnp ACCEPT tcp -- anywhere anywhere tcp dpt:ndmp ACCEPT tcp -- anywhere anywhere tcp dpt:https ACCEPT tcp -- anywhere anywhere tcp dpt:http ACCEPT tcp -- anywhere anywhere tcp dpt:imaps ACCEPT tcp -- anywhere anywhere tcp dpt:imap ACCEPT tcp -- anywhere anywhere tcp dpt:pop3s ACCEPT tcp -- anywhere anywhere tcp dpt:pop3 ACCEPT tcp -- anywhere anywhere tcp dpt:ftp-data ACCEPT tcp -- anywhere anywhere tcp dpt:ftp ACCEPT tcp -- anywhere anywhere tcp dpt:domain ACCEPT tcp -- anywhere anywhere tcp dpt:submission ACCEPT tcp -- anywhere anywhere tcp dpt:smtp ACCEPT tcp -- anywhere anywhere tcp dpt:ssh   Chain FORWARD (policy ACCEPT) target prot opt source destination   Chain OUTPUT (policy ACCEPT) target prot opt source destination
Tue, 06/18/2013 - 10:25
Locutus

Well this is indeed a rather odd setup, having two IP addresses and the default gateway in three completely different networks, with /32 netmasks... I'm afraid to make any sense of that, I'd need to take a look at the system myself when it is in operation and fiddle around with it. Right now I can't ping or trace either of your IPs.

By the way, why do you have an additional virtual network card with a separate MAC in the VM, instead of just assigning an additional IP to the primary network card? Since both are virtual, I don't really see the usefulness of that.

Tue, 06/18/2013 - 17:09 (Reply to #8)
MrGreen

Thank for all.

i've run the server now.

It's a test server (the ips is used on the morning in France for other use)

how do you can to take access ? (you want root access ? where can i give you that ?)

Tue, 06/18/2013 - 17:49 (Reply to #9)
MrGreen

I ask to my hoster if i can have only one mac address for all my ips.... after that, where i can tel at virtualmin the new ips ? Only on VirtualMin -> Addresses and Networking ??

Thanks

Wed, 06/19/2013 - 01:51
MrGreen

I've read something on the web : http://www.murmuran.net/fr/2013/03/13/serveur-d%C3%A9di%C3%A9-ovh-deux-i...

i've test this

echo "2 178.33.40.226" > /etc/iproute2/rt_tables
route add -host 176.31.182.254 dev eth2
route add default gw 176.31.182.254 dev eth2
ip route add default via 176.31.182.254 dev eth2 table 178.33.40.226
ip rule add from 176.31.182.254 lookup 178.33.40.226 prio 1000
ip route flush table cache

but after that, i can ping eth2, but cannot ping the eth0

an idea ?

Thu, 06/20/2013 - 15:18
Locutus

This kind of address setup is not really something I've seen before, but I could try. :)

Are you using an instant messenger? Please tell me your screen name(s) if so.

Mon, 06/24/2013 - 04:35
MrGreen

Hello,

Thanks for your help, but i've choose to set the IPs on one MAC ADDR...

It's ok now ;)

Thanks