Multiple IP's on an interface (Linux)

Jeroen1000

Limp Gawd
Joined
Sep 17, 2010
Messages
266
Since my last thread got a stuck, I decided to ask your opinion on something I've tested working. Quick and simple intro first:

- Cable modem assigns a 10.x.x.x/something IP _if_ a digital tv setup box asks for an IP address (using DHCP)
- Cable modem assings a different IP, subnet, gateway, DNS, if consumer gear (router, computers,...) ask an IP (using DHCP).

What did I do:


I cloned the setup box MAC address on my routers WAN-interface.

Result:

Setup box fully operational, no computers can access the internet.


My router (Draytek Vigor 2130) is based on Linux. Does anyone know whether it is possible to create a virtual interface with a different MAC address so my computer can regain internet access.
 
I have no idea what you are asking. What is your internet provider? Why does your set-top box need a certain ip?
 
It's good isp practice to keep pcs and stbs in separate networks (ones are publicly accessible, the others are not).
 
I don't really know why they hand out different addresses to their setup boxes. It's annoying 4 sure:).

But if it does not get an addresss in a specific subnet, its interactive services (video on demand, tv-guide) do not work (I.E. it cannot access the internet).
 
Code:
# cp /etc/sysconfig/network-scripts/ifcfg-eth0  /etc/sysconfig/network-scripts/ifcfg-eth0:1
# vi /etc/sysconfig/network-scripts/ifcfg-eth0:1

DEVICE=[B]eth0:1[/B]   <--- change to
IPADDR=[B]<enter second ip>[/B]
NETMASK=[B]<your netmask>[/B]
GATEWAY=[B]<your gateway>[/B]
ONBOOT=yes
BOOTPROTO=static

# /etc/init.d/network restart
 
why did you clone your settop box's mac onto the router?

Then I could hand out a 192.168.10.x/24 IP to the setup box and observe whether natting would work correctly. By cloning the MAC address the ISP is 'tricked' in believing the router is the setup box (and no it is not illegal:D)
 
Code:
# cp /etc/sysconfig/network-scripts/ifcfg-eth0  /etc/sysconfig/network-scripts/ifcfg-eth0:1
# vi /etc/sysconfig/network-scripts/ifcfg-eth0:1

DEVICE=[B]eth0:1[/B]   <--- change to
IPADDR=[B]<enter second ip>[/B]
NETMASK=[B]<your netmask>[/B]
GATEWAY=[B]<your gateway>[/B]
ONBOOT=yes
BOOTPROTO=static

# /etc/init.d/network restart

I need to obtain the IP via DHCP and I need to issue a cloned MAC address to that interface. If I change the MAC of the virtual interface, it changes the MAC of the real physical interface also:mad:
 
Short of custom made injection sw, I don't see how you're gonna accomplish what you want.
 
if you specify which modem you are exactly talking about and which ISP and internet and TV service you have, we might be able to figure out what you are trying to do and why, because a standard "cable modem" does not do any of the things you said yours does (splitting different devices into different networks). it sounds like you might have a fiber ONT or some other modem/router combo that does a few different functions.

i know mac spoofing on virtual network adapters can be done under windows, but my linux is not so good.

also- its 'set-top box', not 'setup box'. its the box that sits on top of your TV set.

you referenced another thread which i have never read, have no link to, and have no idea what you tried or what was suggested in that one. bump the old thread instead of making new ones.
 
macvlan is supposed to do what you want. Unfortunately, there are tons of threads/posts about macvlan not working properly and no apparent solutions. I think you will have to get a router with at least two WAN ports.
 
IF your modem will accept multiple mac addresses, the easiest solution is to put a switch between your router and modem. Then plug your router into a port on the switch and plug all your stb's into the switch. Then your modem will hand out ip addresses accordingly, however isp's vary with their macs per modem policies. It sounds like in your case, that'll work.
 
Back
Top