Community discussions

MikroTik App
 
niren
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 76
Joined: Mon Oct 14, 2013 9:59 am

Configure static IP for mikrotik router

Tue Mar 25, 2014 5:20 pm

I have mikrotik router connected with broadband connection. Right now we don't have any static IP but I have applied to get Static IP, so I'll get static IP soon. As of now my mikrotik configuration is

Broadband -> Mikrotik router -> Switch -> 10 systems(over LAN)
/ip address> print

 #   ADDRESS            NETWORK         INTERFACE                              
 1   192.168.2.1/24     192.168.2.0     ether2                       
 2 D 106.51.183.234/32  106.51.128.1    pppoe-out
I can access Mikrotik router from my system/private network by 192.168.2.1. Later on we are going to allow employees to work from home by RDP over VPN. For this I need one static IP for mikrotik router, then router will port mapping to individual systems. So I need to configure static IP for mikrotik router, how can I do this?. If I reset the above address list as
/ip address> print

 #   ADDRESS            NETWORK         INTERFACE                              
 1   xxx.xxx.xxx.xxx     192.168.2.0     ether2                       
 2 D 106.51.183.234/32  106.51.128.1    pppoe-out
where xxx.xxx.xxx.xxx is static IP.

Will this setup work? Here I want my private network to be remain private with 192.168.2.2-192.168.2.100 IPs and the mikrotik router would have static IP, so that I can access mikrotik router from anywhere.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12571
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Configure static IP for mikrotik router

Tue Mar 25, 2014 9:18 pm

I have mikrotik router connected with broadband connection. Right now we don't have any static IP but I have applied to get Static IP, so I'll get static IP soon. As of now my mikrotik configuration is

Broadband -> Mikrotik router -> Switch -> 10 systems(over LAN)
/ip address> print

 #   ADDRESS            NETWORK         INTERFACE                              
 1   192.168.2.1/24     192.168.2.0     ether2                       
 2 D 106.51.183.234/32  106.51.128.1    pppoe-out
I can access Mikrotik router from my system/private network by 192.168.2.1. Later on we are going to allow employees to work from home by RDP over VPN. For this I need one static IP for mikrotik router, then router will port mapping to individual systems. So I need to configure static IP for mikrotik router, how can I do this?. If I reset the above address list as
/ip address> print

 #   ADDRESS            NETWORK         INTERFACE                              
 1   xxx.xxx.xxx.xxx     192.168.2.0     ether2                       
 2 D 106.51.183.234/32  106.51.128.1    pppoe-out
where xxx.xxx.xxx.xxx is static IP.

Will this setup work? Here I want my private network to be remain private with 192.168.2.2-192.168.2.100 IPs and the mikrotik router would have static IP, so that I can access mikrotik router from anywhere.
now:
2 D 106.51.183.234/32 106.51.128.1 pppoe-out
later:
2 D 106.51.66.6/32 106.51.128.1 pppoe-out

Is your Dynamic IP, in the future if you got Fixed IP, simply do NOTHING and use 106.51.66.6 for nat rules.
 
niren
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 76
Joined: Mon Oct 14, 2013 9:59 am

Re: Configure static IP for mikrotik router

Sat May 10, 2014 8:19 pm

now:
2 D 106.51.183.234/32 106.51.128.1 pppoe-out
later:
2 D 106.51.66.6/32 106.51.128.1 pppoe-out

Is your Dynamic IP, in the future if you got Fixed IP, simply do NOTHING and use 106.51.66.6 for nat rules.

I got static IP and trying to configure in mikrotik router. Check this link http://forum.mikrotik.com/viewtopic.php?f=13&t=83329 which describes problems that I faced while configure pppoe in mikrotik router and resolved it. Now after I got static IP, I configured static IP as @rextended said, the moment I configured Static IP in address it turned into red color(means Invalid ) then

I changed pppoe-out to ether1-Input in the address rule
Disabled pppoe-out entry in ppp.
Changed NAT rule's out-interface from pppoe-out to ether1-Input .

Right now my configuration are
[niren@MikroTik] > ip address print
Flags: X - disabled, I - invalid, D - dynamic 
 #   ADDRESS            NETWORK         INTERFACE                         
 0   192.168.2.1/24     192.168.2.0     ether2                                 
 1   xxx.xxx.18.153/22   xxx.xxx.16.0     ether1-Input 

[niren@MikroTik] > interface print
Flags: D - dynamic, X - disabled, R - running, S - slave 
 #     NAME                             TYPE               MTU L2MTU  MAX-L2MTU
 0  R  ether1-Input                     ether             1500  1598       4074
 1  R  ether2                           ether             1500  1598       4074
 2  X  pppoe-out                       pppoe-out  

[niren@MikroTik] > ip firewall nat print
Flags: X - disabled, I - invalid, D - dynamic 
 0   ;;; srcnat LAN private IP's traffic to be masquerade
     chain=srcnat action=masquerade to-addresses=xxx.xxx.16.1 
     src-address=192.168.2.0/24 out-interface=ether1-Input

[niren@MikroTik] > ip dns print 
                servers: xxx.xxx.21.12,xxx.xxx.20.101
        dynamic-servers: 
  allow-remote-requests: no
    max-udp-packet-size: 4096
             cache-size: 2048KiB
          cache-max-ttl: 1w
             cache-used: 8KiB
I don't use username and password which are given by internet provider. Now I can able to ping gatway of wan network from my system which is connected to mikrotik router.
C:\Users\niren>ping xxx.xxx.16.1

Pinging xxx.xxx.16.11 with 32 bytes of data:
Request timed out.
Reply from xxx.xxx.16.1: bytes=32 time=1ms TTL=254
Reply from xxx.xxx.16.1: bytes=32 time=1ms TTL=254
Reply from xxx.xxx.16.1: bytes=32 time=1ms TTL=254
But unable to connect to internet
C:\Users\niren>ping 8.8.8.8

Pinging 8.8.8.8 with 32 bytes of data:
Request timed out.
Reply from 192.168.2.1: Destination net unreachable.
Reply from 192.168.2.1: Destination net unreachable.
Reply from 192.168.2.1: Destination net unreachable.
I can't even ping dns address. Any help? I need to configure this quickly.
 
niren
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 76
Joined: Mon Oct 14, 2013 9:59 am

Re: Configure static IP for mikrotik router

Sat May 10, 2014 8:46 pm

Solved I had to add route as
[niren@MikroTik] /ip route> add dst-address=0.0.0.0/0 gateway=xxx.xxx.16.1
 
User avatar
saintofinternet
Forum Veteran
Forum Veteran
Posts: 773
Joined: Thu Oct 15, 2009 3:52 am

Re: Configure static IP for mikrotik router

Tue Oct 04, 2016 7:14 am

hello,

i am in a similar situation and non of the solutions on this forum worked. can anyone please guide me...

i have a ISP who gives me a DSL line to which I have to dial-up using PPPoE. till date all was fine because he gave me Dynamic IP.

my structure is as follows:

(ISP) ---> DSL ---> (TP-LINK DSL Modem Bridge Mode) ---> LAN CABLE ---> (Mikrotik RB450G)

my Ethernet1 on Mikrotik was connected to the Yellow port on a TP-LINK DSL and Mikrotik was configured to dial out using PPPoE Client. I used to get the Dynamic IP and then i used NAT (Masquerade) in Mikrotik to make my life complete. WHOA!!!! Honey I got Internet....

that was history...... now i have a Static IP from the ISP.

i just fail to understand where to put the Static IP in Mikrotik PPPoE Client (Dial-up) option because I still need to use the dial-up part to connect to the ISP.

the only difference is I now i have a Fixed IP from the ISP...

please help!!!
 
Rudios
Forum Veteran
Forum Veteran
Posts: 977
Joined: Mon Mar 11, 2013 12:58 pm
Location: The Netherlands

Re: Configure static IP for mikrotik router

Tue Oct 04, 2016 9:29 am

How about just configuring your ISP supplied IP address to the PPPoE client, and disable the DHCP-client on it?
 
User avatar
saintofinternet
Forum Veteran
Forum Veteran
Posts: 773
Joined: Thu Oct 15, 2009 3:52 am

Re: Configure static IP for mikrotik router

Tue Oct 04, 2016 10:27 am

could you please tell me how to get the IP configured for the PPPoE interface?

the interface gets an IP as soon as it connects to the ISP. how can i disable the interface from getting a DHCP IP?
 
Rudios
Forum Veteran
Forum Veteran
Posts: 977
Joined: Mon Mar 11, 2013 12:58 pm
Location: The Netherlands

Re: Configure static IP for mikrotik router

Tue Oct 04, 2016 2:05 pm

Aaah, I just thought how about disabling the DHCP client on that specific interface, but I just checked one of my test systems and found out that DHCP client can not be bound to a PPPoE client interface. I assume that it will grab an IP automatically.
Isn't your ISP supplying you with your static assigned IP the moment your PPPoE comes online?
I can remember from the past when I was on PPPoE that it was like that.
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4047
Joined: Wed May 11, 2011 6:08 pm

Re: Configure static IP for mikrotik router

Tue Oct 04, 2016 9:07 pm

Guys - a static IP address on a PPPoE connection just means that they'll always be assigning you the same address.
Do nothing.
Sip some coffee or tea.
The address is now static.

Worst case - after they update your AAA profile on their end, you have to disconnect and reconnect to receive the new static-assigned address. (they may even bounce the connection from their end). PPPoE is designed to negotiate the local and remote addresses. The most you can do by configuring your end with a static IP address is basically telling your router: don't agree to any address but this one. If they give something else, then hang up and dial again. In other words, you'd rather be DOWN than UP with the wrong IP.

It's like getting a static lease in DHCP - the client device doesn't need to do anything special to get the same address all the time. It just needs to continue being the same device (MAC address).
 
dan1el
just joined
Posts: 2
Joined: Tue Nov 22, 2016 7:59 am

Re: Configure static IP for mikrotik router

Tue Nov 22, 2016 8:20 am

I am trying to migrate from a D-Link DIR-615 to RB951G-2HnD

I am given the following static IP by my ISP: 17x.x.x.137/30 which gives me 2 usable Public IPs. Authentication is via PPPoE which needs to be on vlan ID 500.
The current setup is that the D-Link's Public IP is 17x.x.x.137 and the first Ethernet port will assign 17x.x.x.138 to whatever is connected.

In the D-link the setup is simple:
Static PPPoE
User Name: xxx@xxx
Password: xxx
IP Address: 17x.x.x.137
IP Netmask: 255.255.255.252
LAN Start IP: 17x.x.x.138
LAN End IP: 17x.x.x.138

On the Mikrotik, I created the VLAN interface and can connect to the ISP and receive the static IP Address: 17x.x.x.137 as expected.
How do I set ether2 to be allowed to use 17x.x.x.138?
From my understanding I have to put the PPPoE interface on a bridge with the ether2 interface, but I can't do that. Any help is appreciated.

Thanks.
 
dan1el
just joined
Posts: 2
Joined: Tue Nov 22, 2016 7:59 am

Re: Configure static IP for mikrotik router

Tue Nov 22, 2016 12:11 pm

Hi All,

I managed to solve my problem. I created a bridge to bridge ether1 (where the pppoe interface is) and ether2.
I applied the static IP given by the ISP on this bridge (17x.x.x.137/30).
My server/firewall which is configured as 17x.x.x.138/30 connected to ether2 now works.

So the answer was to bridge the physical interface where the pppoe virtual interface was located.

Thanks.

Who is online

Users browsing this forum: boxcee and 40 guests