LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   IP Alias on Fedora Core 6 not working right, Operation not permitted (https://www.linuxquestions.org/questions/linux-newbie-8/ip-alias-on-fedora-core-6-not-working-right-operation-not-permitted-501690/)

loewen 11-14-2006 10:48 PM

IP Alias on Fedora Core 6 not working right, Operation not permitted
 
Good day.

I am relatively new to Linux so please bear with me.

I am trying to set up my linux box as a gateway. I have 2 NICs one is for my internal Lan and the other to the internet. I have two public IPs and I want to set it up so that hitting any of the two IP goes to my FC6 box.

Ive setup the following scripts:
/etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE=eth2:0
ONBOOT=yes
BOOTPROTO=static
IPADDR=202.91.162.50
NETMASK=255.255.255.224
GATEWAY=202.91.162.30

/etc/sysconfig/network-scripts/ifcfg-eth2:0
DEVICE=eth2:0
ONBOOT=yes
BOOTPROTO=static
IPADDR=202.91.162.51
NETMASK=255.255.255.224
GATEWAY=202.91.162.30

/etc/sysconfig/network-scripts/ifcfg-eth4
DEVICE=eth4
HWADDR=00:0a:5e:78:43:18
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=192.168.1.1
NETMASK=255.255.255.0
TYPE=Ethernet

ifconfig:
eth2 Link encap:Ethernet HWaddr 00:14:BF:59:D8:BC
inet addr:202.91.162.50 Bcast:202.91.162.255 Mask:255.255.255.224
inet6 addr: fe80::214:bfff:fe59:d8bc/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:243524425 errors:0 dropped:39 overruns:0 frame:0
TX packets:233951453 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3236639444 (3.0 GiB) TX bytes:503261719 (479.9 MiB)
Interrupt:74 Base address:0xc100
eth2:0 Link encap:Ethernet HWaddr 00:14:BF:59:D8:BC
inet addr:202.91.162.50 Bcast:202.91.162.255 Mask:255.255.255.224
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:74 Base address:0xc100


As you can see, I tried setting up an alias on my eth2. eth2:0 actually goes up but when I try to ping my public IP's from within my FC6 box, it says something like :

ping: sendmsg: Operation not permitted

And when I tried to ssh from a remote machine (outside my network, from internet), I can get in only if I use IP assigned to eth2, but not the IP assigned to eth2:0.

I want to set up this IP on this same box so I can forward ssh requests to another linux box on my network.

Need help badly. Thanks

kstan 11-15-2006 12:31 AM

try change eth2:0 to eth2:1

irado 11-17-2006 09:47 AM

hi.;)
think that either you typed wrong data or it is realy wrong.

If you have 2 nic's, it MUST begin at 0 (zero), say:

eth0
eth1
[..]

and for the aliases, it must follow these rules:
eth0:0
eth0:1

obviously, you must change the 0 (zero) by your real nic identity number.

do:

dmesg | grep -i eth

and

lspci

to read HOW your Linux is naming your nic's.


All times are GMT -5. The time now is 02:30 AM.