1

How can I create a logical local loopback like the procedure here for a Juniper router. (Not talking about 127.0.0.1)

Configure a Local Loopback Action

To configure a local loopback without physically connecting the transmit port to the receive port, follow these steps:

  1. In configuration mode, go to the following hierarchy level:

    [edit]

    user@host# edit interfaces interface-name (fastether-options | gigether-options)

  2. Configure the local loopback:

    [edit interfaces interface-name (fastether-options | gigether-options)]

    user@host# set loopback

Fabby
  • 34,341
  • 38
  • 97
  • 191
Alex
  • 113
  • 4
  • You're talking about configuring a logical loopback, aren't you? that's a pretty big difference to just using a physical or local 127.0.0.1 loopback. I would definitely mention that in the title... Could you also add an ifconfig to your question as that will definitely help(reading the article and *trying* to figure out what you're *really* trying to do...) – Fabby Nov 27 '14 at 12:12
  • This is the AskUbuntu Forum. You're trying to do a logical loopback on a Juniper Switch... :-( Sorry for the downvote. – Fabby Nov 27 '14 at 12:19
  • @Fabby There is written how can I do Local Loopback (not localhost) on JUNOS (Juniper operating system) by using `edit interface` util, but want to know how can I do the same on Ubuntu OS by using `ifconfig` util? – Alex Nov 27 '14 at 12:56
  • My bad! Editing your answer so I can upvote... What version of Ubuntu are you using? – Fabby Nov 27 '14 at 13:00
  • @Fabby Ubuntu 10.04 TLS – Alex Nov 27 '14 at 13:02
  • As an apology to you, I've edited myself and will be looking into it again... – Fabby Nov 27 '14 at 13:04
  • I haven't forgotten about you, just needed to reboot my machine a few times! Interesting problem... ;) – Fabby Nov 27 '14 at 14:53
  • *One dumb question from me:* I can think of a few uses on switches, but *why* would you **ever** want to do this on an OS??? – Fabby Nov 30 '14 at 04:11
  • 1
    @Fabby Uses Hardware Loopback testing (with Loopback Plug) as in article, is a simple and high-grade test of network card on the server without any switches and any connections. Uses Logical Loopback testing (without Loopback Plug), test the testing script before using Hardware Loopback testing. – Alex Nov 30 '14 at 10:15

1 Answers1

1

Dead easy (if you know how)

sudo ifdown eth0
gksudo gedit /etc/network/interfaces

Add the following to the end:

auto eth0
allow-hotplug eth0
iface eth0 inet loopback
iface eth0 inet static
    address 192.168.200.200
    netmask 255.255.255.0

execute:

sudo ifup eth0

Presto: an eth0 loopback in software!

ping 192.168.200.200
PING 192.168.200.200 (192.168.200.200) 56(84) bytes of data.
64 bytes from 192.168.200.200: icmp_seq=1 ttl=64 time=0.073 ms
64 bytes from 192.168.200.200: icmp_seq=2 ttl=64 time=0.042 ms
64 bytes from 192.168.200.200: icmp_seq=3 ttl=64 time=0.069 ms
64 bytes from 192.168.200.200: icmp_seq=4 ttl=64 time=0.044 ms
^C
--- 192.168.200.200 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2997ms
rtt min/avg/max/mdev = 0.042/0.057/0.073/0.014 ms
Fabby
  • 34,341
  • 38
  • 97
  • 191
  • Thank you! But in the article we send ping and don't receive the answer, instead of it we get (TTL) Time to live exceeded, because ICMP packet is infinitely looped over the link. Or does it happen only in Hardware Loopback, but not in Logical Loopback? – Alex Nov 30 '14 at 10:19
  • I don't understand what you're trying to say: you mean that you've implemented the above solution and it doesn't work? I had to reboot a few times while I was testing because I made some mistakes, so you might have to reboot too. – Fabby Nov 30 '14 at 12:10