0

I have a tunnel with a third-party computer. This tunnel iface has the ip address of 10.244.248.126. The third-party just told me that there is an ACL that will allow only IPs from the range 10.245.1.224/28. I'd love to issue telnet -b with and IP address of the given range, but I have no interface with a IP address in this range. How do I create such interface so that I can telnet correctly? How do I route it?

Thanks in advance

UPDATE: I can now bind thanks to the responses, but I'm getting timeout on the telnet -b. Looking at the tcpdump it seems that it is going to the wrong interface, but I'm not sure about that, because I don't know if the MAC addr should be from my virtual iface or not. Below are the ifaces, tunnel and routing tables:

https://gist.github.com/847934

https://gist.github.com/847957

https://gist.github.com/847932

Thiago
  • 287
  • 1
  • 2
  • 7
  • Where is the tunnel established? If it's your router (and your default gateway), you should be able to telnet to it, provided it's setup correctly. – gravyface Feb 28 '11 at 17:40

4 Answers4

3

Add an alias to your network card configuration:

ifconfig eth0:telnet 10.245.1.225 netmask 255.255.255.240

You already have a tunnel, so the routing should work. Or how is the routing defined now? You may need to add a route, but we will need more info about your connection. First test if

ping 10.244.248.126

works. Then start your telnet session using "-b"

telnet -b eth0:telnet 10.244.248.126
rems
  • 2,260
  • 13
  • 11
  • 1
    `ifconfig ethN:M` is a bit outdated; nowadays it's preferable to use `ip addr add ip.ip.ip.ip/mask dev ethN` – poige Feb 28 '11 at 18:44
  • I still have the routing issues, but your answer pushed me further. Thanks! – Thiago Mar 01 '11 at 14:36
1

If I understand you correctly, you need to define a virtual interface to be able to use the new address as bind address in telnet. Simply, this can be done using the command:

$ sudo ifconfig eth0:0 <your_ip_address> netmask <your_mask> up

Of course, you need to replace and IP and mark with the appropriate values.

For the routing part, it depends on your network setup and addressing.

Khaled
  • 36,533
  • 8
  • 72
  • 99
1

Also, telnet -b doesn't dereference IPs from interfaces (at least not on any Linux machine I've ever seen). You actually need to specify the desired IP.

(There's an argument that it should work like this, and I'm sympathetic to it. Any new socket code I write is probably going to support this as an option, and I might patch this into things. Honestly I had no idea you could do eth0:[string], I actually thought you had to do eth0:[number])

dakami
  • 11
  • 2
0

i think you may need a TUN/TAP interface which bridges with your physical NIC. you would need uml-utilities for that. I often use that to simulate networks. The command is tunctl

or, you can change your existing tunnel to reflect the new ip subnet

Edit: Looking at your configurations, i think you need to setup a bridge(brctl?). When you make new interfaces, how can you make sure they are communicating with your physical NIC?

fmysky
  • 94
  • 6