tr3s Posted July 23, 2005 Report Share Posted July 23, 2005 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 Quote Link to comment Share on other sites More sharing options...
streeter Posted July 23, 2005 Report Share Posted July 23, 2005 ifconfig eth0:1 192.168.4.1 up (or whatever IP address you need) should do the trick Chris Quote Link to comment Share on other sites More sharing options...
tr3s Posted July 25, 2005 Author Report Share Posted July 25, 2005 (edited) 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 Edited July 25, 2005 by tr3s Quote Link to comment Share on other sites More sharing options...
Qchem Posted July 25, 2005 Report Share Posted July 25, 2005 /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. Quote Link to comment Share on other sites More sharing options...
streeter Posted July 25, 2005 Report Share Posted July 25, 2005 (edited) 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 July 25, 2005 by streeter Quote Link to comment Share on other sites More sharing options...
tr3s Posted July 26, 2005 Author Report Share Posted July 26, 2005 it's working now... thanks everybody!!! ok, one last thing.. this virtual interface will not start at boot, right? how do i set it to start at boot? tnx again Quote Link to comment Share on other sites More sharing options...
aioshin Posted July 26, 2005 Report Share Posted July 26, 2005 try to append those command that you'd just issued that creates a secondary eth on a file called rc.local. /etc/rc.d/rc.local and those commands will run at start-up Quote Link to comment Share on other sites More sharing options...
tr3s Posted July 26, 2005 Author Report Share Posted July 26, 2005 (edited) 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... Edited July 26, 2005 by tr3s Quote Link to comment Share on other sites More sharing options...
Qchem Posted July 27, 2005 Report Share Posted July 27, 2005 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 Quote Link to comment Share on other sites More sharing options...
tr3s Posted July 27, 2005 Author Report Share Posted July 27, 2005 (edited) 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 July 27, 2005 by tr3s Quote Link to comment Share on other sites More sharing options...
Qchem Posted July 27, 2005 Report Share Posted July 27, 2005 You don't appear to have a route for eth0:1 (although I've never tried using virtual interfaces so this may be correct). Hopefully Streeter will show up soon and show us what to do. :P Quote Link to comment Share on other sites More sharing options...
streeter Posted July 30, 2005 Report Share Posted July 30, 2005 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.