1

I have an interface already configured for an internal interface, which is static under eth0. My question is, can I create a dynamic outfacing interface under eth1.

The reason I want to so this is because, my ISP doesn't support fixed external IP addresses and I am running a server using DynDns. The problem is, I need to set a rule in iptables to FORWARD traffic to my external IP and I need an interface to specify it to iptables, therefore if I use my current external IP it will change.

My output of ifconfig:

root@helloworld:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0e:7f:a9:10:54  
          inet addr:192.168.0.8  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::20e:7fff:fea9:1054/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:357 errors:0 dropped:0 overruns:0 frame:0
          TX packets:358 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:37555 (37.5 KB)  TX bytes:43900 (43.9 KB)
          Interrupt:20 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:36 errors:0 dropped:0 overruns:0 frame:0
          TX packets:36 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:3467 (3.4 KB)  TX bytes:3467 (3.4 KB)
root@helloworld:~# 
1
  • 1
    Are you using a router to connect to the internet? Usually the router connects to your ISP (and gets an external ip) and you connect to your router by LAN (local area network) with an intern IP Adress - the router usually masquerades your internal IP by using NAT. How do you connect to the internet?
    – Wolfgang
    Commented Mar 9, 2014 at 10:59

1 Answer 1

1

Without catching what you really want to do you could use multiple instances of your interface: See setting up multiple ips in ubuntu

Hope this helps

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .