LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-10-2004, 05:09 AM   #1
citrus
Member
 
Registered: Dec 2003
Location: California
Distribution: Kubuntu 6.1
Posts: 548

Rep: Reputation: 30
2 ip address 1 nic card?


i have 2 ips from my isp

is it possible to bind both of them to 1 nic card on my linux server
so that i can have the linux server as one IP and 2 other computers connected to the box as a different IP and the other 2 computer connecting to the box via DHCP????
 
Old 07-10-2004, 06:01 AM   #2
frelihm
Member
 
Registered: Jan 2003
Location: Ljubljana, Slovenia, Europe
Distribution: debian
Posts: 72

Rep: Reputation: 15
i would recommend you to use one ip for server. You can make with your two computers a LAN and on server (with ip) you cane use ip masquerading. That means, in your local network, every box has it's own ip, assigned by adminsitrator (you) and when you connect to internet via your server, the server memorizes incoming ip and transforms it into ip, which was given by ISP. So, you need for your server only one ip.
 
Old 07-10-2004, 06:11 AM   #3
citrus
Member
 
Registered: Dec 2003
Location: California
Distribution: Kubuntu 6.1
Posts: 548

Original Poster
Rep: Reputation: 30
thats not what i want tho

i just want to know if what i want is possible

cuz i need the other 2 computers to have a different WAN IP
theres no way around it
 
Old 07-10-2004, 06:19 AM   #4
frelihm
Member
 
Registered: Jan 2003
Location: Ljubljana, Slovenia, Europe
Distribution: debian
Posts: 72

Rep: Reputation: 15
WAN IP are assigned by YOU, not from ISP, don't you get it?

Your first machine's IP: 192.168.100.100
Your seconds machine's IP: 192.168.100.101

for example, and then if you access to net from either comps, you get:

192.168.100.101 ---> translates to -----> your server's ip and voila, you're winner
 
Old 07-10-2004, 07:27 AM   #5
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 50
citrus

you can have

eth0:0 IPAddress1
eth0:1 Ipaddress2

with slack t0, you can

ip addr add x.x.x.x dev eth0
ip addr add x x x x1 dev eth0

Last edited by ppuru; 07-10-2004 at 07:29 AM.
 
Old 07-10-2004, 08:07 AM   #6
citrus
Member
 
Registered: Dec 2003
Location: California
Distribution: Kubuntu 6.1
Posts: 548

Original Poster
Rep: Reputation: 30
THANK YOU PPURU

now how would i configure the machine to USE one of the ips for the internet and one of the ips as a dhcp server so my other computers can connect to that?

by the way i haven't ever set up a dhcp server before
so i am going to need a little help

the linux machine has 2 nic cards and i will put the 2 ips on on nice card and then the second card is where i will connect my switch so the other 2 computers will conect to the machine via dhcp thru the other IP

i just want to make sure the first ip is ONLY for the servers internet
and the second one is ONLY for the other computers

thanks in advance
 
Old 07-10-2004, 08:48 AM   #7
Nichole_knc
Member
 
Registered: Mar 2004
Location: Georgia
Distribution: SlackWare 10.1+, FreeBSD 4.4-5.2, Amiga 1.3,2.1,3.1, Windors XP Pro (makes a fair answering machine)
Posts: 287

Rep: Reputation: 30
You want a DMZ and a NAT2LAN rig...

Ok for this to happen with only 2 nics you are going to have to do a bit of hack trickery.
The best method would be to have a router box set up with 3 nics (1 WAN both IPs, routed to- 1 nic, DMZ, 1 nic, LAN). But it can be done on one box.

You will need to insure iptables with NAT is compiled in your kernel as mods. Also you will have to edit the route tables to point the IP you want at the LAN nic.
See the firewall howtos for a good firewall script for NAT and edit accordingly. Doing so will insure that the "server" addy does not pass to the LAN nic. Also this is where the route tables come in ($>man route). It is much the same as making a router.
 
Old 07-10-2004, 10:58 AM   #8
citrus
Member
 
Registered: Dec 2003
Location: California
Distribution: Kubuntu 6.1
Posts: 548

Original Poster
Rep: Reputation: 30
woah
 
Old 07-11-2004, 05:45 AM   #9
Nichole_knc
Member
 
Registered: Mar 2004
Location: Georgia
Distribution: SlackWare 10.1+, FreeBSD 4.4-5.2, Amiga 1.3,2.1,3.1, Windors XP Pro (makes a fair answering machine)
Posts: 287

Rep: Reputation: 30
Yep quite a bit huh...

Here is where to find the HOWTO to set up a dhcp server using the dhcpd. If you installed the HOWTOS. See the server section. As I pointed out above you also have to "point" the dhcpd to the nic you want to provide dhcp to.
Note: MULTICAST must be complied into the kernel
HOWTO location
usr/doc/Linux-HOWTOs/DHCP
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
eth0 NIC Card Not Working! 3com 3c501 NIC. Mustard010 Linux - Networking 16 08-15-2007 03:22 AM
2 NIC in 1 IP Address wizznew Linux - Hardware 7 11-23-2005 02:06 AM
Nic card changes Gateway address for ppp0 How can I fix this? Tiyogi Red Hat 2 03-30-2004 10:45 PM
NIC IO address olivermaunder Linux - Networking 5 02-04-2004 08:51 AM
2 nic but 1 ip address roberto.zoni Linux - Networking 5 07-01-2003 08:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration