LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 09-19-2007, 07:55 AM   #1
Jaidan
LQ Newbie
 
Registered: Jan 2007
Posts: 8

Rep: Reputation: 0
"ip" command / Multiple public IP's


Edit: Since posting this I've come to understand a little more...OpenWRT uses udhcpc to make requests...by using the command udhcpc -i eth1 I'm able to request an ip from my ISP...unfortunately it always returns the same IP...so I'm not sure how to get it to return to me a new one. Once I figure that out I can write a script to request the IP, then use ip addr add etc etc. At least that's what I'm thinking....but still need somemore to bridge teh gap between what I have and what I need.

Ok...So I'm in a little over my head at this point, so I apologize ahead of time if my descriptions of the situation are not the best, but here goes.

I have a router, this router is running OpenWRT, an embedded linux router distro. I have recently requested a second IP address be allocated to me from my ISP. Now the addresses they provide are of course not static, so I have to DHCP to get them. Keeping in mind this is a router my tools and configurations are somewhat limited. Now through a bunch of investigating, and a little help it appears the tool "ip" (ip-cref Contents) should be able to do what I need it to do. I have it installed..but for the life of me I can't figure out what I'm supposed to do with it.

Making matter slightly more complicated (for anyone already familiar with openwrt) I'm running a router that uses a slightly different configuration than most other routers. I actually have 3 network interfaces active, eth1 (WAN), eth0 (4 port LAN switch), and eth2 (actually the Wifi). To be a little more specifi if there happen to be any hardcore openwrt users...I'm using an Asus WL-500W.

the command I need (at least to start with) I think should be something like: "ip addr add dev eth0 label eth1:1" Now this isn't complete nor is it probably 100% right for the parts I have even...I'm hoping someone here with more networking knowledge might be able to help get me out of this hole.


Summary:

Basically I have a network interface card facing the internet. I want this interface to pull 2 ip's via DHCP. I'm limited on tools and configurations...I don't have much networking knowledge. After I figure out how to deal with getting the two ip addresses I need to work out how to use the route commands to handle getting the correct request to the correct computer.
 
Old 09-19-2007, 12:16 PM   #2
Jaidan
LQ Newbie
 
Registered: Jan 2007
Posts: 8

Original Poster
Rep: Reputation: 0
Ok...So I've made a ton of progress. In order to get the second IP I do as follows:

ip addr add dev eth1 label eth1:1 0.0.0.0
udhcpc -i eth1:1

With that I get two different ip's assigned to the interface and subinterface of eth1...next step read up on routes. So I can figure out how to get the correct IP's forwarded to the correct computers.

So pretty much most of my first post is moot...as I have it almost all done now.
 
Old 09-20-2007, 06:08 PM   #3
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
I’m glad to see you figured out your first problem (getting the second IP). For the second problem, take a look at this.

Also, if I may I ask, what’s the wisdom of using two dynamic IP addresses from the same provider?
 
Old 09-23-2007, 01:14 AM   #4
Jaidan
LQ Newbie
 
Registered: Jan 2007
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks I'll take a look at that. As for the reasoning...well we would like to have 2 ip address due to a game that both my roomate and I like to play together. This particular game uses a weird p2p (and rather poorly coded from what I've gathered, but what can you do the game is great) host sharing system that wants all players to have certain open ports. Behind one router with one IP this becomes a large problem causing disconnects, latency, and inability to connect to many other players (or even eachother a lot of time).

To alleviate that buying a second IP from them will allow us to open the appropriate ports on both computers. I could probably get them fixed...but at an additional cost. Since I can script the connections to provide the appropriate forwarding based on whatever IP's are assigned, and I'm not using the IP's to provide a permanent web hosting...dynamic should in the end work out just as well even if it sucks a little now.
 
  


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
Shell Script: Find "Word" Run "Command" granatica Linux - Software 5 07-25-2007 07:42 AM
C Drive "/dev/hda1" accidently used in dd command at "of=" switch M D Linux - Software 4 04-26-2007 08:56 AM
"list dynamic dependency" of an executable using command other than "ldd" Amrita@3086 Solaris / OpenSolaris 3 04-04-2007 04:56 AM
IPTables - Multiple Public IP's to private IP's matneyc Linux - Security 8 05-27-2005 12:23 PM
Tiny Sofa 2.0 - I thought "halt", "reboot" were only root command ?? sorcerer Linux - Distributions 1 08-21-2004 03:28 PM

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

All times are GMT -5. The time now is 03:49 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
Open Source Consulting | Domain Registration