Rudy Giuliani introduces Republican vice-presidential nominee Mike Pence during his campaign stop along side presidential nominee Donald Trump at the International Exposition Center on October 22, 2016 in Cleveland, Ohio.

President Donald Trump's attorney, Rudy Giuliani, has his own ideas about how to best secure the southern border.

In a phone interview with CNBC, Giuliani said that the best course of action may not be to build a "great wall," as the president has suggested. Rather, Giuliani said, Trump could be better off with a structure with advanced technology that could pick up immigrants trying to cross the border.

"I don't see the magic in a wall, as long as there's some form of improved barrier that picks up penetration," said Giuliani, a former mayor of New York who represents Trump in the special counsel's Russia investigation. "I could build a wall for him with long-range cameras and security. He needs something. I think he'd compromise if he got most of what he wanted."

Giuliani runs his own security firm, Giuliani Security & Safety, which is a subsidiary of his larger private company Giuliani Partners. Giuliani is defending Trump in the ongoing probe being conducted by special counsel Robert Mueller into whether Russian operatives colluded with members of Trump's campaign during the 2016 presidential election.

Democrats and Republicans have been fighting about adding $5 billion in border wall funding to a short-term spending bill that would keep the government open until early February. Republican House leaders, along with members of the conservative House Freedom Caucus, met with Trump at the White House on Thursday. The president made it clear he would not sign the bill without some form of funding for border security, including a wall.

Without a stopgap spending agreement, the government will partially shut down at the end of Friday.

"We just had a very long, productive meeting with the president," Republican House Speaker Paul Ryan told reporters after he met with the president for more than an hour at lunchtime. "The president informed us that he will not sign the bill that came up from the Senate last evening because of his legitimate concerns for border security."

Giuliani told CNBC that he had not talked to Trump about the issue recently, and that he was speaking for himself. Yet, Giuliani acknowledged that the president fully owns the notion of building a border wall.

"I talked to him a lot during the campaign. He owns the wall. I can't tell you how many times I was at rallies when I heard 'build a wall, build a wall,'" Giuliani said. "The whole idea is that someone is offended about building a wall but they (the Democrats) all favored it years ago. That's political bull----."

Giuliani said Trump's base would be "disappointed" if the president couldn't pull off some form of a wall – but added that they would still support him going forward.

"I think his constituents would accept it because you got to view his overall performance and he's delivered about everything but you can already hear that they would be disappointed in him," Giuliani said. "This wasn't a political gimmick. He believes in the wall."

Conservative commentator Ann Coulter, who was one of Trump's most ardent supporters, has slammed the president for appearing to back off on the idea of shutting down the government over a lack of border wall funding. In a blog post on Wednesday, Coulter labeled Trump "gutless."

"He's in trouble now. As absurd as the Russia nonsense is, the details about Trump's sleazy associates, the porn star, the Playboy playmate and his seedy business practices leave his supporters feeling queasy, even if he hasn't committed any crimes," she wrote.