Jump to content

multiple ip address in one network card


tr3s
 Share

Recommended Posts

hi!

 

wondering if i can assign two ip address on one NIC in Mandrake 10.1 community. i used to have that in winxp.. 1 for live ip and 1 for lan. i have a SiS900 10/100 NIC

 

i have read ip aliasing how-to's for redhat but i can't get it to work in mandrake. do they differ?

 

any work around?

 

tnx

Link to comment
Share on other sites

tnx Chris..

 

by the way, the subnet mask in the live and lan is different. this is what i need to set up:

 

lan ip (the one that is currently up)

192.168.0.3

255.255.255.0

 

live ip (i need to add this)

ip address: 202.82.192.166

subnet mask: 255.255.255.241

gateway: 202.82.192.161

 

what else should i need to do?

 

p.s.

 

ifconfig alone doesn't work, will /sbin/ifconfig do?

a newbie here :cheesy:

Edited by tr3s
Link to comment
Share on other sites

/sbin/ifconfig and ifconfig are the same thing.

 

when you attempt to launch a command from a terminal session (such as ifconfig) looks in set places for the executable (these set places are known as the PATH). If it can't find the command you need to be explicit about the program you want to run and need to use /sbin/ifconfig in this case.

 

When you switch to root in a terminal use "su -" rather than "su" (without the quotes) and you'll find that /sbin is now in the PATH and you can just type ifconfig.

Link to comment
Share on other sites

ifconfig eth0:1 202.82.192.166 netmask 255.255.255.241 up

 

See man ifconfig

 

Not sure from your post if this is the network you are using to access the Internet, but if it is, you will need to add the default route to your routing table. You may also need to remove an existing default route too.

 

route del default
route add default gw 202.82.192.161 eth0:1

 

or is your routing even more complicated?

 

Chris

 

EDIT: Just noticed the netmask - surely that should be 240 ??

Edited by streeter
Link to comment
Share on other sites

i think im still having problems here...

 

eth0 and eth0:1 are now both up and also on start up. i can ping both the router which is the gateway and other machines on lan.

 

the problem is when i'm browsing the lan or the internet. browsing the network is very slow and sometimes i have to reload several times to display the list of computers on nautillus. i can't also browse the network using the linneighborhood. this is happening when i set the local ip address as the primary interface (eth0) and the live ip as the virtual (eth0:1). i can surf the net, though.

 

i tried to switch the two interface. i can now browse the network fast and mount samba shares through linneighborhood but cannot anymore browse the web.

 

any suggestions will be very much appreciated... :thumbs:

Edited by tr3s
Link to comment
Share on other sites

I would guess that you're having trouble with the routing table. If you can post your routing table (obtained by running the command route as root from a terminal) then we'll take a look at it.

 

Also post the contents of /etc/resolv.conf

Link to comment
Share on other sites

here is the result of the route command:

 

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
202.86.192.160  *               255.255.255.248 U     0      0        0 eth0
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
default         ip-192-161.bell 0.0.0.0         UG    0      0        0 eth0

 

 

 

here's the contents of /etc/resolv.conf:

 

search localhost
nameserver 202.86.196.2
nameserver 202.86.196.3

 

# ppp temp entry

 

note: im able to review the ip config.. settings on the above post is wrong

Edited by tr3s
Link to comment
Share on other sites

Virtual interfaces don't show up in the routing table, but it all looks OK to me, assuming nothing else has changed (are both the IP addresses shown in ifconfig?)

 

Wonder why route resolved the ip address in the default route line of your routing table, but not the first line... these addresses should be the same. You should use route -n to view the table - it shows the addresses without doing a DNS lookup.

 

If the virtual interfaces work, but the 'real' one doesn't, perhaps it might be worth trying 2 virtual ones?

 

ie eth0:1 and eth0:2 - worth a try :)

 

You should be able to set the virtual interfaces up at boot by making new files in /etc/sysconfig/network-scripts. Copy the ifcfg-eth0 file, edit it and rename to ifcfg-eth0:1 etc...

 

Chris

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...